Added mousewheel support to scroll view

This commit is contained in:
Max Lynch
2014-02-19 16:26:04 -08:00
parent 53af2c7a01
commit 2e6f640b4a

View File

@@ -315,6 +315,9 @@ ionic.views.Scroll = ionic.views.View.inherit({
startX: 0,
startY: 0,
/** The amount to dampen mousewheel events */
wheelDampen: 6,
/** The minimum size the scrollbars scale to while scrolling */
minScrollbarSizeX: 5,
minScrollbarSizeY: 5,
@@ -682,6 +685,9 @@ ionic.views.Scroll = ionic.views.View.inherit({
mousedown = false;
}, false);
document.addEventListener("mousewheel", function(e) {
self.scrollBy(e.wheelDeltaX/self.options.wheelDampen, -e.wheelDeltaY/self.options.wheelDampen);
});
}
},