diff --git a/js/angular/directive/content.js b/js/angular/directive/content.js index 880765ece7..8276f06f18 100644 --- a/js/angular/directive/content.js +++ b/js/angular/directive/content.js @@ -47,7 +47,7 @@ function($timeout, $controller, $ionicBind) { compile: function(element, attr) { var innerElement; - element.addClass('scroll-content'); + element.addClass('scroll-content ionic-scroll'); if (attr.scroll != 'false') { //We cannot use normal transclude here because it breaks element.data() diff --git a/js/angular/directive/scroll.js b/js/angular/directive/scroll.js index 58da440b92..e32f283d25 100644 --- a/js/angular/directive/scroll.js +++ b/js/angular/directive/scroll.js @@ -31,7 +31,7 @@ function($timeout, $controller, $ionicBind) { scope: true, controller: function() {}, compile: function(element, attr) { - element.addClass('scroll-view'); + element.addClass('scroll-view ionic-scroll'); //We cannot transclude here because it breaks element.data() inheritance on compile var innerElement = jqLite('
'); diff --git a/js/utils/dom.js b/js/utils/dom.js index 193a62ed15..65b8d6a1cb 100644 --- a/js/utils/dom.js +++ b/js/utils/dom.js @@ -250,17 +250,6 @@ return null; }, - elementHasParent: function(element, parent) { - var current = element; - while (current) { - if (current.parentNode === parent) { - return true; - } - current = current.parentNode; - } - return false; - }, - /** * @ngdoc method * @name ionic.DomUtil#rectContains diff --git a/js/views/scrollView.js b/js/views/scrollView.js index ce8bfd76d2..4f8078a45d 100644 --- a/js/views/scrollView.js +++ b/js/views/scrollView.js @@ -838,12 +838,15 @@ ionic.views.Scroll = ionic.views.View.inherit({ }; self.mouseWheel = ionic.animationFrameThrottle(function(e) { - if (ionic.DomUtil.elementHasParent(e.target, self.__container)) { + var scrollParent = ionic.DomUtil.getParentOrSelfWithClass(e.target, 'ionic-scroll'); + if (scrollParent === self.__container) { + self.hintResize(); self.scrollBy( e.wheelDeltaX/self.options.wheelDampen, -e.wheelDeltaY/self.options.wheelDampen ); + self.__fadeScrollbars('in'); clearTimeout(self.__wheelHideBarTimeout); self.__wheelHideBarTimeout = setTimeout(function() {