Skip to content

Commit 4afc767

Browse files
committed
feat(refresher): allow spinner to be none. closes #2926
1 parent e8a70f3 commit 4afc767

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Diff for: js/angular/controller/refresherController.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ IonicModule
2424
$attrs.$set('pullingIcon', 'ion-android-arrow-down');
2525
}
2626

27-
$scope.showSpinner = !isDefined($attrs.refreshingIcon);
27+
$scope.showSpinner = !isDefined($attrs.refreshingIcon) && $attrs.spinner != 'none';
28+
29+
$scope.showIcon = isDefined($attrs.refreshingIcon);
2830

2931
$ionicBind($scope, $attrs, {
3032
pullingIcon: '@',

Diff for: js/angular/directive/refresher.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
* Default: 'ion-android-arrow-down'.
5353
* @param {string=} spinner The {@link ionic.directive:ionSpinner} icon to display
5454
* after user lets go of the refresher. The SVG {@link ionic.directive:ionSpinner}
55-
* is now the default, replacing rotating font icons.
55+
* is now the default, replacing rotating font icons. Set to `none` to disable both the
56+
* spinner and the icon.
5657
* @param {string=} refreshing-icon The font icon to display after user lets go of the
5758
* refresher. This is depreicated in favor of the SVG {@link ionic.directive:ionSpinner}.
5859
* @param {boolean=} disable-pulling-rotation Disables the rotation animation of the pulling
@@ -76,7 +77,7 @@ IonicModule
7677
'<div class="text-pulling" ng-bind-html="pullingText"></div>' +
7778
'<div class="icon-refreshing">' +
7879
'<ion-spinner ng-if="showSpinner" icon="{{spinner}}"></ion-spinner>' +
79-
'<i ng-if="!showSpinner" class="icon {{refreshingIcon}}"></i>' +
80+
'<i ng-if="showIcon" class="icon {{refreshingIcon}}"></i>' +
8081
'</div>' +
8182
'<div class="text-refreshing" ng-bind-html="refreshingText"></div>' +
8283
'</div>' +

Diff for: test/unit/angular/directive/refresher.unit.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,15 @@ describe('ionRefresher directive', function() {
8888
var el = setup();
8989
expect(el[0].querySelector('ion-spinner')).toBeTruthy();
9090
});
91-
it('should have spinner', function() {
91+
it('should allow a custom spinner', function() {
9292
var el = setup('spinner="android"');
9393
expect(el[0].querySelector('.spinner-android')).toBeTruthy();
9494
});
95+
it('should allow spinner to be none', function() {
96+
var el = setup('spinner="none"');
97+
expect(el[0].querySelector('ion-spinner')).not.toBeTruthy();
98+
expect(el[0].querySelector('.icon.icon-refreshing')).not.toBeTruthy();
99+
});
95100
it('should allow custom refreshingIcon', function() {
96101
var el = setup('refreshing-icon="monkey-icon"');
97102
expect(el[0].querySelector('.icon.icon-refreshing.ion-arrow-down-c')).toBeFalsy();

0 commit comments

Comments
 (0)