diff --git a/dist/css/ionic.css b/dist/css/ionic.css index 18eaa35b7b..bf15b6937f 100644 --- a/dist/css/ionic.css +++ b/dist/css/ionic.css @@ -2324,7 +2324,8 @@ body, .ionic-body { .scroll-refresher-content { height: 100%; width: 100%; - text-align: center; } + text-align: center; + position: relative; } .scroll-refreshing { -webkit-transition: height 0.1s ease-in-out; } diff --git a/dist/js/ionic-angular.js b/dist/js/ionic-angular.js index b09b470086..00b29efbcc 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -487,6 +487,7 @@ angular.module('ionic.ui.content', []) replace: true, template: '
', transclude: true, + scope: true, compile: function(element, attr, transclude) { return function($scope, $element, $attr) { var c = $element.eq(0); @@ -512,7 +513,10 @@ angular.module('ionic.ui.content', []) } else { // Otherwise, supercharge this baby! var sv = new ionic.views.Scroll({ - el: $element[0].firstElementChild + el: $element[0].firstElementChild, + onRefresh: function() { + $scope.onRefresh && $scope.onRefresh(); + } }); // Let child scopes access this $scope.scrollView = sv; @@ -530,7 +534,6 @@ angular.module('ionic.ui.content', []) restrict: 'E', replace: true, transclude: true, - scope: true, template: '
' } }) diff --git a/dist/js/ionic.js b/dist/js/ionic.js index 494d8f93ca..9b74cf85bf 100644 --- a/dist/js/ionic.js +++ b/dist/js/ionic.js @@ -2419,6 +2419,7 @@ window.ionic = { this._refresher.style.display = 'none'; } else { this._isRefresherHidden = false; + this._didTriggerRefresh = false; this._refresher.style.display = 'block'; } @@ -2627,12 +2628,14 @@ window.ionic = { _this._refresher.classList.add('scroll-refreshing'); //_this._refresher.style.height = firstChildHeight + 'px'; _this._scrollTo(0, _this._refresherHeight, 100, _this.refreshEasing); - _this.onRefresh && _this.onRefresh(); + if(!_this._didTriggerRefresh) { + _this.onRefresh && _this.onRefresh(); + _this._didTriggerRefresh = true; + } } else { _this._refresher.classList.add('scroll-refreshing'); //_this._refresher.style.height = 0 + 'px'; _this._scrollTo(0, 0, _this.refreshEasingTime, _this.refreshEasing); - _this.onRefresh && _this.onRefresh(); } return; } diff --git a/js/ext/angular/src/directive/ionicContent.js b/js/ext/angular/src/directive/ionicContent.js index e57b87881f..7800d3e2df 100644 --- a/js/ext/angular/src/directive/ionicContent.js +++ b/js/ext/angular/src/directive/ionicContent.js @@ -20,6 +20,7 @@ angular.module('ionic.ui.content', []) replace: true, template: '
', transclude: true, + scope: true, compile: function(element, attr, transclude) { return function($scope, $element, $attr) { var c = $element.eq(0); @@ -45,7 +46,10 @@ angular.module('ionic.ui.content', []) } else { // Otherwise, supercharge this baby! var sv = new ionic.views.Scroll({ - el: $element[0].firstElementChild + el: $element[0].firstElementChild, + onRefresh: function() { + $scope.onRefresh && $scope.onRefresh(); + } }); // Let child scopes access this $scope.scrollView = sv; @@ -63,7 +67,6 @@ angular.module('ionic.ui.content', []) restrict: 'E', replace: true, transclude: true, - scope: true, template: '
' } }) diff --git a/js/ext/angular/test/content.html b/js/ext/angular/test/content.html index b5b3477f99..326492a0c5 100644 --- a/js/ext/angular/test/content.html +++ b/js/ext/angular/test/content.html @@ -42,7 +42,10 @@ #refresh-content { color: #999; text-align: center; - font-size: 20px; + font-size: 48px; + position: absolute; + bottom: 10px; + width: 100%; } @@ -52,9 +55,11 @@
- + - Refreshing +
+ +