Skip to content

Commit

Permalink
fix($ionicLoading): do not flicker when showing long loading messages
Browse files Browse the repository at this point in the history
Closes #1252
  • Loading branch information
ajoslin committed May 14, 2014
1 parent efa6184 commit 90e7395
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions js/angular/service/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function($document, $ionicTemplateLoader, $ionicBackdrop, $timeout, $q, $log, $c
ionic.DomUtil.centerElementByMarginTwice(self.element[0]);
ionic.requestAnimationFrame(function() {
self.isShown && self.element.addClass('active');
ionic.DomUtil.centerElementByMarginTwice(self.element[0]);
});
}
});
Expand Down
5 changes: 4 additions & 1 deletion js/utils/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,11 @@
centerElementByMarginTwice: function(el) {
ionic.requestAnimationFrame(function() {
ionic.DomUtil.centerElementByMargin(el);
ionic.requestAnimationFrame(function() {
setTimeout(function() {
ionic.DomUtil.centerElementByMargin(el);
setTimeout(function() {
ionic.DomUtil.centerElementByMargin(el);
});
});
});
},
Expand Down
4 changes: 2 additions & 2 deletions test/html/loading.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
.controller('LoadingCtrl', function($scope, $ionicLoading) {
$scope.startLoading = function() {
$ionicLoading.show({
template: 'Getting current location...',
template: '<div>Connection problem.</div><br/><div>Please check your internet connection!</div>',
delay: 100,
duration: 500
duration: 3000
});
};
});
Expand Down

0 comments on commit 90e7395

Please sign in to comment.