From 767ce6a3b4d6e20d383c47ea72efe4208301a108 Mon Sep 17 00:00:00 2001 From: Perry Govier Date: Wed, 17 Sep 2014 13:37:51 -0500 Subject: [PATCH] fix(loading): prevent spinners in loading view from causing reflows when hidden. Closes #2013 --- js/angular/service/loading.js | 2 +- scss/_loading.scss | 3 +++ test/html/loading.html | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/angular/service/loading.js b/js/angular/service/loading.js index a2f7ab25921..fe7f73cf0c2 100644 --- a/js/angular/service/loading.js +++ b/js/angular/service/loading.js @@ -54,7 +54,7 @@ var LOADING_SET_DEPRECATED = '$ionicLoading instance.setContent() has been depre */ IonicModule .constant('$ionicLoadingConfig', { - template: '' + template: '' }) .factory('$ionicLoading', [ '$ionicLoadingConfig', diff --git a/scss/_loading.scss b/scss/_loading.scss index 55bc26294c8..e15ac779076 100644 --- a/scss/_loading.scss +++ b/scss/_loading.scss @@ -21,6 +21,9 @@ visibility: hidden; opacity: 0; + &:not(.visible) .icon { + display: none; + } &.visible { visibility: visible; } diff --git a/test/html/loading.html b/test/html/loading.html index fae95596691..041ba4f7ca1 100644 --- a/test/html/loading.html +++ b/test/html/loading.html @@ -19,7 +19,7 @@ .controller('LoadingCtrl', function($scope, $ionicLoading) { $scope.startLoading = function() { $ionicLoading.show({ - template: '
Connection problem.

Please check your internet connection!
', + //template: '
Connection problem.

Please check your internet connection!
', delay: 100, duration: 3000 });