Loading: use popup-manager to handle fullscreen z-index

pull/6039/merge
Leopoldthecoder 2018-01-29 15:23:38 +08:00 committed by 杨奕
parent cdc14756ae
commit 840c4b57be
3 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import Vue from 'vue';
import Loading from './loading.vue';
import { addClass, removeClass, getStyle } from 'element-ui/src/utils/dom';
import { PopupManager } from 'element-ui/src/utils/popup';
import afterLeave from 'element-ui/src/utils/after-leave';
const Mask = Vue.extend(Loading);
@ -13,6 +14,7 @@ loadingDirective.install = Vue => {
if (binding.modifiers.fullscreen) {
el.originalPosition = getStyle(document.body, 'position');
el.originalOverflow = getStyle(document.body, 'overflow');
el.maskStyle.zIndex = PopupManager.nextZIndex();
addClass(el.mask, 'is-fullscreen');
insertDom(document.body, el, binding);
@ -71,7 +73,7 @@ loadingDirective.install = Vue => {
el.instance.$emit('after-leave');
} else {
el.instance.visible = true;
};
}
});
el.domInserted = true;
}

View File

@ -1,6 +1,7 @@
import Vue from 'vue';
import loadingVue from './loading.vue';
import { addClass, removeClass, getStyle } from 'element-ui/src/utils/dom';
import { PopupManager } from 'element-ui/src/utils/popup';
import afterLeave from 'element-ui/src/utils/after-leave';
import merge from 'element-ui/src/utils/merge';
@ -42,6 +43,7 @@ const addStyle = (options, parent, instance) => {
if (options.fullscreen) {
instance.originalPosition = getStyle(document.body, 'position');
instance.originalOverflow = getStyle(document.body, 'overflow');
maskStyle.zIndex = PopupManager.nextZIndex();
} else if (options.body) {
instance.originalPosition = getStyle(document.body, 'position');
['top', 'left'].forEach(property => {

View File

@ -13,7 +13,7 @@
@include b(loading-mask) {
position: absolute;
z-index: 10000;
z-index: 2000;
background-color: rgba(255, 255, 255, .9);
margin: 0;
top: 0;