Skip to content

Commit 5c893ab

Browse files
committed
fix(ionRefresher): do not animate pulling-text
Closes #909
1 parent 7eff208 commit 5c893ab

File tree

3 files changed

+69
-62
lines changed

3 files changed

+69
-62
lines changed

js/ext/angular/src/directive/ionicContent.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function($timeout, $controller, $ionicBind) {
7171
element.addClass('scroll-content');
7272

7373
if (attr.scroll != 'false') {
74-
//We cannot use normal transclude here because it breaks element.data()
74+
//We cannot use normal transclude here because it breaks element.data()
7575
//inheritance on compile
7676
innerElement = angular.element('<div class="scroll"></div>');
7777
innerElement.append(element.contents());
@@ -208,11 +208,11 @@ function($timeout, $controller, $ionicBind) {
208208
require: '^$ionicScroll',
209209
template:
210210
'<div class="scroll-refresher">' +
211-
'<div class="ionic-refresher-content">' +
211+
'<div class="ionic-refresher-content">' +
212212
'<i class="icon {{pullingIcon}} icon-pulling"></i>' +
213-
'<div class="icon-pulling pulling-text" ng-bind-html="pullingText"></div>' +
213+
'<div class="text-pulling" ng-bind-html="pullingText"></div>' +
214214
'<i class="icon {{refreshingIcon}} icon-refreshing"></i>' +
215-
'<div class="icon-refreshing refreshing-text" ng-bind-html="refreshingText"></div>' +
215+
'<div class="text-refreshing" ng-bind-html="refreshingText"></div>' +
216216
'</div>' +
217217
'</div>',
218218
compile: function($element, $attrs) {

js/ext/angular/test/list-fit.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h1 class="title">Footer!</h1>
7070
$scope.onRefresh = function() {
7171
$timeout(function() {
7272
$scope.$broadcast('scroll.refreshComplete');
73-
}, 1000);
73+
}, 1500);
7474
};
7575
$scope.more = [];
7676
$scope.addMore = function() {

scss/_scaffolding.scss

+64-57
Original file line numberDiff line numberDiff line change
@@ -138,52 +138,6 @@ body.grade-c {
138138
}
139139
}
140140

141-
142-
// Scroll refresher (for pull to refresh)
143-
.scroll-refresher {
144-
position: absolute;
145-
top: -60px;
146-
right: 0;
147-
left: 0;
148-
overflow: hidden;
149-
margin: auto;
150-
height: 60px;
151-
152-
.icon-refreshing {
153-
@include animation-duration(1.5s);
154-
display: none;
155-
}
156-
}
157-
158-
.scroll-refresher-content {
159-
position: absolute;
160-
bottom: 15px;
161-
left: 0;
162-
width: 100%;
163-
color: $scroll-refresh-icon-color;
164-
text-align: center;
165-
166-
font-size: 30px;
167-
}
168-
169-
.ionic-refresher-content {
170-
position: absolute;
171-
bottom: 15px;
172-
left: 0;
173-
width: 100%;
174-
color: $scroll-refresh-icon-color;
175-
text-align: center;
176-
177-
font-size: 30px;
178-
179-
.icon-pulling {
180-
@include animation-name(refresh-spin-back);
181-
@include animation-duration(200ms);
182-
@include animation-timing-function(linear);
183-
@include animation-fill-mode(both);
184-
}
185-
}
186-
187141
@keyframes refresh-spin {
188142
0% { transform: rotate(0); }
189143
100% { transform: rotate(-180deg); }
@@ -204,31 +158,84 @@ body.grade-c {
204158
100% {-webkit-transform: rotate(0); }
205159
}
206160

207-
.scroll-refresher.active {
161+
// Scroll refresher (for pull to refresh)
162+
.scroll-refresher {
163+
position: absolute;
164+
top: -60px;
165+
right: 0;
166+
left: 0;
167+
overflow: hidden;
168+
margin: auto;
169+
height: 60px;
170+
171+
.ionic-refresher-content {
172+
position: absolute;
173+
bottom: 15px;
174+
left: 0;
175+
width: 100%;
176+
color: $scroll-refresh-icon-color;
177+
text-align: center;
178+
179+
font-size: 30px;
180+
181+
.text-refreshing,
182+
.text-pulling {
183+
line-height: 16px;
184+
font-size: 16px;
185+
}
186+
}
208187

209188
.icon-pulling {
210-
display: block;
189+
@include animation-name(refresh-spin-back);
190+
@include animation-duration(200ms);
191+
@include animation-timing-function(linear);
192+
@include animation-fill-mode(both);
211193
}
212-
.icon-refreshing {
194+
.icon-refreshing,
195+
.text-refreshing {
213196
display: none;
214197
}
198+
.icon-refreshing {
199+
@include animation-duration(1.5s);
200+
}
215201

216-
&.refreshing {
202+
&.active {
203+
.icon-pulling,
204+
.text-pulling {
205+
display: block;
206+
}
217207
.icon-pulling {
218-
display: none;
208+
@include animation-name(refresh-spin);
219209
}
220-
.icon-refreshing {
221-
display: block;
210+
.icon-refreshing,
211+
.text-refreshing {
212+
display: none;
222213
}
223-
}
224214

225-
.ionic-refresher-content {
226-
i.icon.icon-pulling {
227-
@include animation-name(refresh-spin);
215+
&.refreshing {
216+
.icon-pulling,
217+
.text-pulling {
218+
display: none;
219+
}
220+
.icon-refreshing,
221+
.text-refreshing {
222+
display: block;
223+
}
228224
}
229225
}
230226
}
231227

228+
.scroll-refresher-content {
229+
position: absolute;
230+
bottom: 15px;
231+
left: 0;
232+
width: 100%;
233+
color: $scroll-refresh-icon-color;
234+
text-align: center;
235+
236+
font-size: 30px;
237+
}
238+
232239
// Infinite scroll
233240
ion-infinite-scroll .scroll-infinite {
234241
position: relative;

0 commit comments

Comments
 (0)