diff --git a/dist/css/ionic.css b/dist/css/ionic.css index b8d816ee7b..0dff314fd5 100644 --- a/dist/css/ionic.css +++ b/dist/css/ionic.css @@ -2327,6 +2327,22 @@ body, .ionic-body { text-align: center; position: relative; } +.ionic-refresher-content { + height: 100%; + width: 100%; + text-align: center; + position: relative; } + +.ionic-refresher { + width: 10px; + height: 10px; + border-radius: 50%; + background-color: #4a87ee; + position: absolute; + left: 50%; + margin-left: -5px; + bottom: 15px; } + .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 7a91d5837b..0c30d7a4aa 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -548,11 +548,29 @@ angular.module('ionic.ui.content', []) return { restrict: 'E', replace: true, - transclude: true, - template: '
' + require: ['^?content', '^?list'], + template: '
', + scope: true, + link: function($scope, $element, $attr, scrollCtrl) { + $scope.$on('onRefresh', function() { + }); + $scope.$on('onRefreshOpening', function(amt) { + console.log('On refresh opening', amt); + }); + } } }) +.directive('scroll-refresher', function() { + return { + restrict: 'E', + replace: true, + transclude: true, + template: '
' + } +}); + + })(); ; (function() { @@ -667,9 +685,11 @@ angular.module('ionic.ui.list', ['ngAnimate']) hasPullToRefresh: ($scope.hasPullToRefresh !== 'false'), onRefresh: function() { $scope.onRefresh(); + $scope.$broadcast('onRefresh'); }, onRefreshOpening: function(amt) { $scope.onRefreshOpening({amount: amt}); + $scope.$broadcast('onRefreshOpening', amt); } }); diff --git a/js/ext/angular/src/directive/ionicContent.js b/js/ext/angular/src/directive/ionicContent.js index c15d895daf..0d988b4cd0 100644 --- a/js/ext/angular/src/directive/ionicContent.js +++ b/js/ext/angular/src/directive/ionicContent.js @@ -76,9 +76,27 @@ angular.module('ionic.ui.content', []) return { restrict: 'E', replace: true, - transclude: true, - template: '
' + require: ['^?content', '^?list'], + template: '
', + scope: true, + link: function($scope, $element, $attr, scrollCtrl) { + $scope.$on('onRefresh', function() { + }); + $scope.$on('onRefreshOpening', function(amt) { + console.log('On refresh opening', amt); + }); + } } }) +.directive('scroll-refresher', function() { + return { + restrict: 'E', + replace: true, + transclude: true, + template: '
' + } +}); + + })(); diff --git a/js/ext/angular/src/directive/ionicList.js b/js/ext/angular/src/directive/ionicList.js index d8ea69d64a..57eed15e3e 100644 --- a/js/ext/angular/src/directive/ionicList.js +++ b/js/ext/angular/src/directive/ionicList.js @@ -110,9 +110,11 @@ angular.module('ionic.ui.list', ['ngAnimate']) hasPullToRefresh: ($scope.hasPullToRefresh !== 'false'), onRefresh: function() { $scope.onRefresh(); + $scope.$broadcast('onRefresh'); }, onRefreshOpening: function(amt) { $scope.onRefreshOpening({amount: amt}); + $scope.$broadcast('onRefreshOpening', amt); } }); diff --git a/scss/_scaffolding.scss b/scss/_scaffolding.scss index 496d24da60..2b52c14702 100644 --- a/scss/_scaffolding.scss +++ b/scss/_scaffolding.scss @@ -122,6 +122,23 @@ body, .ionic-body { //@include display-flex(); //@include align-items(center); } +.ionic-refresher-content { + height: 100%; + width: 100%; + text-align: center; + position: relative; +} +.ionic-refresher { + // A custom refresher + width: 10px; + height: 10px; + border-radius: 50%; + background-color: $brand-primary; + position: absolute; + left: 50%; + margin-left: -5px; + bottom: 15px; +} .scroll-refreshing { -webkit-transition: height 0.1s ease-in-out; }