From c93c63d72141cb99edbedfb581d9323717e0199e Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Fri, 11 May 2012 09:33:37 -0700 Subject: [PATCH] Editor.scroller WheelEvents are forwarded to Editor.scrollbar --- src/app/editor.coffee | 8 ++++++++ static/editor.css | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 13eb8a573..be90002e4 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -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()) diff --git a/static/editor.css b/static/editor.css index 258c6b416..c30b25781 100644 --- a/static/editor.css +++ b/static/editor.css @@ -43,7 +43,6 @@ bottom: 0; width: 10px; overflow-y: auto; - background: blue; } .editor .scroller {