Editor.scroller WheelEvents are forwarded to Editor.scrollbar

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-05-11 09:33:37 -07:00
parent 9427c82084
commit c93c63d721
2 changed files with 8 additions and 1 deletions

View File

@@ -204,6 +204,14 @@ class Editor extends View
@insertText(e.originalEvent.data)
false
@scroller.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)
@scrollbar.get(0).dispatchEvent(newEvent)
false
@scrollbar.on 'scroll', =>
@updateLines()
@scroller.scrollTop(@scrollbar.scrollTop())

View File

@@ -43,7 +43,6 @@
bottom: 0;
width: 10px;
overflow-y: auto;
background: blue;
}
.editor .scroller {