mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(loading): backdrop higher z-index
This commit is contained in:
19
js/angular/service/backdrop.js
vendored
19
js/angular/service/backdrop.js
vendored
@@ -39,7 +39,6 @@ function($document) {
|
||||
|
||||
var el = jqLite('<div class="backdrop">');
|
||||
var backdropHolds = 0;
|
||||
var backdropExtraClasses = null;
|
||||
|
||||
$document[0].body.appendChild(el[0]);
|
||||
|
||||
@@ -57,23 +56,20 @@ function($document) {
|
||||
* Releases the backdrop.
|
||||
*/
|
||||
release: release,
|
||||
|
||||
getElement: getElement,
|
||||
|
||||
// exposed for testing
|
||||
_element: el
|
||||
};
|
||||
|
||||
function retain(extraClasses) {
|
||||
backdropExtraClasses = extraClasses;
|
||||
|
||||
function retain() {
|
||||
if ( (++backdropHolds) === 1 ) {
|
||||
el.addClass('visible');
|
||||
ionic.requestAnimationFrame(function() {
|
||||
backdropHolds && el.addClass('active');
|
||||
});
|
||||
}
|
||||
if(extraClasses) {
|
||||
console.log('Adding', extraClasses);
|
||||
el.addClass(extraClasses);
|
||||
}
|
||||
}
|
||||
function release() {
|
||||
if ( (--backdropHolds) === 0 ) {
|
||||
@@ -82,7 +78,10 @@ function($document) {
|
||||
!backdropHolds && el.removeClass('visible');
|
||||
}, 100);
|
||||
}
|
||||
el.removeClass(backdropExtraClasses);
|
||||
backdropExtraClasses = null;
|
||||
}
|
||||
|
||||
function getElement() {
|
||||
return el;
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
4
js/angular/service/loading.js
vendored
4
js/angular/service/loading.js
vendored
@@ -141,7 +141,8 @@ function($document, $ionicTemplateLoader, $ionicBackdrop, $timeout, $q, $log, $c
|
||||
//options.showBackdrop: deprecated
|
||||
this.hasBackdrop = !options.noBackdrop && options.showBackdrop !== false;
|
||||
if (this.hasBackdrop) {
|
||||
$ionicBackdrop.retain('backdrop-loading');
|
||||
$ionicBackdrop.retain();
|
||||
$ionicBackdrop.getElement().addClass('backdrop-loading');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,6 +177,7 @@ function($document, $ionicTemplateLoader, $ionicBackdrop, $timeout, $q, $log, $c
|
||||
if (this.isShown) {
|
||||
if (this.hasBackdrop) {
|
||||
$ionicBackdrop.release();
|
||||
$ionicBackdrop.getElement().removeClass('backdrop-loading');
|
||||
}
|
||||
self.element.removeClass('active');
|
||||
setTimeout(function() {
|
||||
|
||||
Reference in New Issue
Block a user