mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(backdrop): Changed z-index for loading backdrop only. Fixes #1428
This commit is contained in:
11
js/angular/service/backdrop.js
vendored
11
js/angular/service/backdrop.js
vendored
@@ -39,6 +39,7 @@ function($document) {
|
||||
|
||||
var el = jqLite('<div class="backdrop">');
|
||||
var backdropHolds = 0;
|
||||
var backdropExtraClasses = null;
|
||||
|
||||
$document[0].body.appendChild(el[0]);
|
||||
|
||||
@@ -60,13 +61,19 @@ function($document) {
|
||||
_element: el
|
||||
};
|
||||
|
||||
function retain() {
|
||||
function retain(extraClasses) {
|
||||
backdropExtraClasses = extraClasses;
|
||||
|
||||
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 ) {
|
||||
@@ -75,5 +82,7 @@ function($document) {
|
||||
!backdropHolds && el.removeClass('visible');
|
||||
}, 100);
|
||||
}
|
||||
el.removeClass(backdropExtraClasses);
|
||||
backdropExtraClasses = null;
|
||||
}
|
||||
}]);
|
||||
|
||||
2
js/angular/service/loading.js
vendored
2
js/angular/service/loading.js
vendored
@@ -141,7 +141,7 @@ function($document, $ionicTemplateLoader, $ionicBackdrop, $timeout, $q, $log, $c
|
||||
//options.showBackdrop: deprecated
|
||||
this.hasBackdrop = !options.noBackdrop && options.showBackdrop !== false;
|
||||
if (this.hasBackdrop) {
|
||||
$ionicBackdrop.retain();
|
||||
$ionicBackdrop.retain('backdrop-loading');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user