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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -651,7 +651,7 @@ $badge-default-text: #AAAAAA !default;
|
||||
|
||||
$z-index-action-sheet: 11 !default;
|
||||
$z-index-badge: 1 !default;
|
||||
$z-index-backdrop: 10 !default;
|
||||
$z-index-backdrop: 11 !default;
|
||||
$z-index-bar: 10 !default;
|
||||
$z-index-bar-title: 0 !default;
|
||||
$z-index-bar-button: 1 !default;
|
||||
@@ -663,11 +663,11 @@ $z-index-item-options: 1 !default;
|
||||
$z-index-item-radio: 3 !default;
|
||||
$z-index-item-reordering: 9 !default;
|
||||
$z-index-item-toggle: 3 !default;
|
||||
$z-index-loading: 11 !default;
|
||||
$z-index-loading: 13 !default;
|
||||
$z-index-menu: 0 !default;
|
||||
$z-index-modal: 10 !default;
|
||||
$z-index-pane: 1 !default;
|
||||
$z-index-popup: 11 !default;
|
||||
$z-index-popup: 12 !default;
|
||||
$z-index-scroll-bar: 9999 !default;
|
||||
$z-index-slider-pager: 1 !default;
|
||||
$z-index-tabs: 5 !default;
|
||||
|
||||
@@ -70,6 +70,14 @@ describe('$ionicLoading service', function() {
|
||||
expect(loader.element.text()).toBe('1 content');
|
||||
}));
|
||||
|
||||
it('should add and remove backdrop-loading to backdrop', inject(function($ionicLoading, $ionicBackdrop) {
|
||||
var loader = TestUtil.unwrapPromise($ionicLoading._getLoader());
|
||||
loader.show({ templateUrl: 'template.html' });
|
||||
expect($ionicBackdrop._element.hasClass('backdrop-loading')).toBe(true);
|
||||
loader.hide();
|
||||
expect($ionicBackdrop._element.hasClass('backdrop-loading')).toBe(false);
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
describe('.hide()', function() {
|
||||
|
||||
Reference in New Issue
Block a user