Skip to content

Commit

Permalink
Merge pull request harvesthq#1983 from efedorenko/wheel-event
Browse files Browse the repository at this point in the history
Fixes scrolling with a mouse wheel in Firefox if jquery-mousewheel is used
  • Loading branch information
stof committed Jun 21, 2014
2 parents f3bb75d + 4aee5ef commit f019dd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class Chosen extends AbstractChosen
this.results_reset(evt) if evt.target.nodeName is "ABBR" and not @is_disabled

search_results_mousewheel: (evt) ->
delta = -evt.originalEvent.wheelDelta or evt.originalEvent.detail if evt.originalEvent
delta = evt.originalEvent.deltaY or -evt.originalEvent.wheelDelta or evt.originalEvent.detail if evt.originalEvent
if delta?
evt.preventDefault()
delta = delta * 40 if evt.type is 'DOMMouseScroll'
Expand Down
2 changes: 1 addition & 1 deletion coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class @Chosen extends AbstractChosen
this.results_reset(evt) if evt.target.nodeName is "ABBR" and not @is_disabled

search_results_mousewheel: (evt) ->
delta = -evt.wheelDelta or evt.detail
delta = evt.deltaY or -evt.wheelDelta or evt.detail
if delta?
evt.preventDefault()
delta = delta * 40 if evt.type is 'DOMMouseScroll'
Expand Down

0 comments on commit f019dd7

Please sign in to comment.