Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
David MacDonald
purr-data
Commits
2f818087
Commit
2f818087
authored
Jun 24, 2017
by
Jonathan Wilkes
Browse files
add event to handle scrolling the menu with the mousewheel
parent
2053f04d
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/nw/pd_canvas.js
View file @
2f818087
...
...
@@ -625,6 +625,9 @@ var canvas_events = (function() {
},
dropdown_menu_mouseup
:
function
(
evt
)
{
var
i
,
select_elem
;
// This can be triggered if the user keeps the mouse down
// to highlight an element and releases the mouse button to
// choose that element
if
(
evt
.
target
.
parentNode
&&
evt
.
target
.
parentNode
.
parentNode
&&
evt
.
target
.
parentNode
.
parentNode
.
id
===
"
dropdown_list
"
)
{
...
...
@@ -634,6 +637,13 @@ var canvas_events = (function() {
canvas_events
.
normal
();
}
},
dropdown_menu_wheel
:
function
(
evt
)
{
// Here we generate bogus mouse coords so that
// we can break through the filter below if we're
// using the mouse wheel to scroll in the list.
last_dropdown_menu_x
=
Number
.
MIN_VALUE
;
last_dropdown_menu_y
=
Number
.
MIN_VALUE
;
},
dropdown_menu_mousemove
:
function
(
evt
)
{
// For whatever reason, Chromium decides to trigger the
// mousemove/mouseenter/mouseover events if the element
...
...
@@ -913,6 +923,8 @@ var canvas_events = (function() {
document
.
addEventListener
(
"
mousemove
"
,
events
.
dropdown_menu_mousemove
,
false
);
document
.
addEventListener
(
"
keydown
"
,
events
.
dropdown_menu_keydown
,
false
);
document
.
addEventListener
(
"
keypress
"
,
events
.
dropdown_menu_keypress
,
false
);
document
.
querySelector
(
"
#dropdown_list
"
)
.
addEventListener
(
"
wheel
"
,
events
.
dropdown_menu_wheel
,
false
);
},
search
:
function
()
{
this
.
none
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment