mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Simplify handling of 'mousewheel' event
This commit is contained in:
@@ -337,11 +337,8 @@ class Editor extends View
|
||||
false
|
||||
|
||||
@scrollView.on 'mousewheel', (e) =>
|
||||
e = e.originalEvent
|
||||
if e.wheelDeltaY
|
||||
newEvent = document.createEvent("WheelEvent");
|
||||
newEvent.initWebKitWheelEvent(0, e.wheelDeltaY, e.view, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey)
|
||||
@verticalScrollbar.get(0).dispatchEvent(newEvent)
|
||||
if delta = e.originalEvent.wheelDeltaY
|
||||
@scrollTop(@scrollTop() - delta)
|
||||
false
|
||||
|
||||
@verticalScrollbar.on 'scroll', =>
|
||||
|
||||
Reference in New Issue
Block a user