mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Added mousewheel support to scroll view
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user