mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -796,6 +796,24 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
}
|
||||
};
|
||||
|
||||
self.mouseWheel = ionic.animationFrameThrottle(function(e) {
|
||||
var scrollParent = ionic.DomUtil.getParentOrSelfWithClass(e.target, 'ionic-scroll');
|
||||
if (scrollParent === self.__container) {
|
||||
|
||||
self.hintResize();
|
||||
self.scrollBy(
|
||||
(e.wheelDeltaX || e.deltaX || 0) / self.options.wheelDampen,
|
||||
(-e.wheelDeltaY || e.deltaY || 0) / self.options.wheelDampen
|
||||
);
|
||||
|
||||
self.__fadeScrollbars('in');
|
||||
clearTimeout(self.__wheelHideBarTimeout);
|
||||
self.__wheelHideBarTimeout = setTimeout(function() {
|
||||
self.__fadeScrollbars('out');
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
if ('ontouchstart' in window) {
|
||||
// Touch Events
|
||||
container.addEventListener("touchstart", self.touchStart, false);
|
||||
@@ -819,6 +837,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
document.addEventListener("MSPointerMove", self.touchMove, false);
|
||||
document.addEventListener("MSPointerUp", self.touchEnd, false);
|
||||
document.addEventListener("MSPointerCancel", self.touchEnd, false);
|
||||
document.addEventListener("wheel", self.mouseWheel, false);
|
||||
|
||||
} else {
|
||||
// Mouse Events
|
||||
@@ -862,24 +881,6 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
mousedown = false;
|
||||
};
|
||||
|
||||
self.mouseWheel = ionic.animationFrameThrottle(function(e) {
|
||||
var scrollParent = ionic.DomUtil.getParentOrSelfWithClass(e.target, 'ionic-scroll');
|
||||
if (scrollParent === self.__container) {
|
||||
|
||||
self.hintResize();
|
||||
self.scrollBy(
|
||||
(e.wheelDeltaX || e.deltaX || 0) / self.options.wheelDampen,
|
||||
(-e.wheelDeltaY || e.deltaY || 0) / self.options.wheelDampen
|
||||
);
|
||||
|
||||
self.__fadeScrollbars('in');
|
||||
clearTimeout(self.__wheelHideBarTimeout);
|
||||
self.__wheelHideBarTimeout = setTimeout(function() {
|
||||
self.__fadeScrollbars('out');
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
container.addEventListener("mousedown", self.mouseDown, false);
|
||||
if(self.options.preventDefault) container.addEventListener("mousemove", self.mouseMoveBubble, false);
|
||||
document.addEventListener("mousemove", self.mouseMove, false);
|
||||
|
||||
Reference in New Issue
Block a user