diff --git a/js/ext/angular/src/controller/ionicScrollController.js b/js/ext/angular/src/controller/ionicScrollController.js index f2cbc9396b..0011d15133 100644 --- a/js/ext/angular/src/controller/ionicScrollController.js +++ b/js/ext/angular/src/controller/ionicScrollController.js @@ -41,7 +41,7 @@ angular.module('ionic.ui.scroll') var refresherHeight = self.refresher.clientHeight || 0; scrollView.activatePullToRefresh(refresherHeight, function() { refresher.classList.add('active'); - refresherScope.$onRefreshOpening(); + refresherScope.$onPulling(); }, function() { refresher.classList.remove('refreshing'); refresher.classList.remove('active'); diff --git a/js/ext/angular/src/directive/ionicContent.js b/js/ext/angular/src/directive/ionicContent.js index 71f6fe8b21..02b88ee226 100644 --- a/js/ext/angular/src/directive/ionicContent.js +++ b/js/ext/angular/src/directive/ionicContent.js @@ -30,27 +30,27 @@ angular.module('ionic.ui.content', ['ionic.ui.service', 'ionic.ui.scroll']) * @module ionic * * @description - * The ionContent directive provides an easy to use content area that can be configured + * The ionContent directive provides an easy to use content area that can be configured * to use Ionic's custom Scroll View, or the built in overflow scorlling of the browser. * - * While we recommend using the custom Scroll features in Ionic in most cases, sometimes + * While we recommend using the custom Scroll features in Ionic in most cases, sometimes * (for performance reasons) only the browser's native overflow scrolling will suffice, - * and so we've made it easy to toggle between the Ionic scroll implementation and + * and so we've made it easy to toggle between the Ionic scroll implementation and * overflow scrolling. * - * You can implement pull-to-refresh with the {@link ionic.directive:ionRefresher} - * directive, and infinite scrolling with the {@link ionic.directive:ionInfiniteScroll} + * You can implement pull-to-refresh with the {@link ionic.directive:ionRefresher} + * directive, and infinite scrolling with the {@link ionic.directive:ionInfiniteScroll} * directive. * * @restrict E * @param {boolean=} scroll Whether to allow scrolling of content. Defaults to true. - * @param {boolean=} overflow-scroll Whether to use overflow-scrolling instead of + * @param {boolean=} overflow-scroll Whether to use overflow-scrolling instead of * Ionic scroll. * @param {boolean=} padding Whether to add padding to the content. * @param {boolean=} has-header Whether to offset the content for a header bar. * @param {boolean=} has-subheader Whether to offset the content for a subheader bar. * @param {boolean=} has-footer Whether to offset the content for a footer bar. - * @param {boolean=} has-bouncing Whether to allow scrolling to bounce past the edges + * @param {boolean=} has-bouncing Whether to allow scrolling to bounce past the edges * of the content. Defaults to true on iOS, false on Android. * @param {expression=} on-scroll Expression to evaluate when the content is scrolled. * @param {expression=} on-scroll-complete Expression to evaluate when a scroll action completes. @@ -90,9 +90,6 @@ function($parse, $timeout, $ionicScrollDelegate, $controller, $ionicBind) { scrollContent = angular.element($element[0].querySelector('.scroll')); $ionicBind($scope, $attr, { - //Use $ to stop onRefresh from recursively calling itself - $onRefresh: '&onRefresh', - $onRefreshOpening: '&onRefreshOpening', $onScroll: '&onScroll', $onScrollComplete: '&onScrollComplete', hasBouncing: '@', @@ -151,14 +148,6 @@ function($parse, $timeout, $ionicScrollDelegate, $controller, $ionicBind) { }); }); - if(attr.refreshComplete) { - $scope.refreshComplete = function() { - if($scope.scrollView) { - $scope.$parent.$broadcast('scroll.onRefreshComplete'); - } - }; - } - } transclude($scope, function(clone) { @@ -188,14 +177,14 @@ function($parse, $timeout, $ionicScrollDelegate, $controller, $ionicBind) { * When refreshing is complete, $broadcast the 'scroll.refreshComplete' event * from your controller. * - * @param {expression=} on-refresh Called when the user pulls down enough and lets go + * @param {expression=} on-refresh Called when the user pulls down enough and lets go * of the refresher. - * @param {expression=} on-pulling Called when the user starts to pull down + * @param {expression=} on-pulling Called when the user starts to pull down * on the refresher. - * @param {string=} pulling-icon The icon to display while the user is pulling down. + * @param {string=} pulling-icon The icon to display while the user is pulling down. * Default: 'ion-arrow-down-c'. - * @param {string=} pulling-text The text to display while the user is pulling down. - * @param {string=} refreshing-icon The icon to display after user lets go of the + * @param {string=} pulling-text The text to display while the user is pulling down. + * @param {string=} refreshing-icon The icon to display after user lets go of the * refresher. * @param {string=} refreshing-text The text to display after the user lets go of * the refresher. @@ -254,7 +243,7 @@ function($parse, $timeout, $ionicScrollDelegate, $controller, $ionicBind) { refreshingIcon: '@', refreshingText: '@', $onRefresh: '&onRefresh', - $onRefreshOpening: '&onRefreshOpening' + $onPulling: '&onPulling' }); scrollCtrl.setRefresher($scope, $element[0]); diff --git a/js/ext/angular/test/controller/ionicScrollController.unit.js b/js/ext/angular/test/controller/ionicScrollController.unit.js index ee55a82cbb..7c18631ef7 100644 --- a/js/ext/angular/test/controller/ionicScrollController.unit.js +++ b/js/ext/angular/test/controller/ionicScrollController.unit.js @@ -92,7 +92,7 @@ describe('$ionicScroll Controller', function() { var scrollOnRefreshSpy = jasmine.createSpy('scroll.onRefresh'); scope.$onRefresh = jasmine.createSpy('onRefresh'); - scope.$onRefreshOpening = jasmine.createSpy('onRefreshOpening'); + scope.$onPulling = jasmine.createSpy('onPulling'); timeout.flush(); var refresher = ctrl.refresher; @@ -103,7 +103,7 @@ describe('$ionicScroll Controller', function() { startCb(); expect(refresher.classList.contains('active')).toBe(true); expect(refresher.classList.contains('refreshing')).toBe(false); - expect(scope.$onRefreshOpening).toHaveBeenCalled(); + expect(scope.$onPulling).toHaveBeenCalled(); refreshingCb(); expect(refresher.classList.contains('active')).toBe(false); diff --git a/js/ext/angular/test/directive/ionicRefresher.unit.js b/js/ext/angular/test/directive/ionicRefresher.unit.js index a8addb14f1..97facf2045 100644 --- a/js/ext/angular/test/directive/ionicRefresher.unit.js +++ b/js/ext/angular/test/directive/ionicRefresher.unit.js @@ -40,11 +40,11 @@ describe('ionRefresher directive', function() { it('should bind $onRefreshOpening', function() { var spyMe = jasmine.createSpy('onRefreshOpening'); - var el = setup('on-refresh-opening="spyMe()"', { + var el = setup('on-pulling="spyMe()"', { spyMe: spyMe }); expect(spyMe).not.toHaveBeenCalled(); - el.scope().$onRefreshOpening(); + el.scope().$onPulling(); expect(spyMe).toHaveBeenCalled(); }); diff --git a/js/ext/angular/test/list-fit.html b/js/ext/angular/test/list-fit.html index c1859a7654..e09a5f1865 100644 --- a/js/ext/angular/test/list-fit.html +++ b/js/ext/angular/test/list-fit.html @@ -16,7 +16,7 @@ - +