add variable scroll speed to ContextMenu

This commit is contained in:
inventivetalent
2019-01-12 16:02:11 +01:00
parent a1798b31d8
commit 8a574062f0
3 changed files with 1104 additions and 1097 deletions

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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);