mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
add variable scroll speed to ContextMenu
This commit is contained in:
@@ -7999,11 +7999,14 @@ function ContextMenu( values, options )
|
||||
function on_mouse_wheel(e)
|
||||
{
|
||||
var pos = parseInt( root.style.top );
|
||||
root.style.top = (pos + e.deltaY * 0.1).toFixed() + "px";
|
||||
root.style.top = (pos + e.deltaY * options.scroll_speed).toFixed() + "px";
|
||||
e.preventDefault();
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!options.scroll_speed)
|
||||
options.scroll_speed = 0.1;
|
||||
|
||||
root.addEventListener("wheel", on_mouse_wheel, true);
|
||||
root.addEventListener("mousewheel", on_mouse_wheel, true);
|
||||
|
||||
|
||||
2191
build/litegraph.min.js
vendored
2191
build/litegraph.min.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -7999,11 +7999,14 @@ function ContextMenu( values, options )
|
||||
function on_mouse_wheel(e)
|
||||
{
|
||||
var pos = parseInt( root.style.top );
|
||||
root.style.top = (pos + e.deltaY * 0.1).toFixed() + "px";
|
||||
root.style.top = (pos + e.deltaY * options.scroll_speed).toFixed() + "px";
|
||||
e.preventDefault();
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!options.scroll_speed)
|
||||
options.scroll_speed = 0.1;
|
||||
|
||||
root.addEventListener("wheel", on_mouse_wheel, true);
|
||||
root.addEventListener("mousewheel", on_mouse_wheel, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user