fix popup manager

This commit is contained in:
cookfront
2017-03-10 17:22:47 +08:00
parent 24e1caca32
commit c5d5c90c06
2 changed files with 11 additions and 21 deletions
+1 -12
View File
@@ -1,22 +1,13 @@
import Vue from 'vue';
import merge from 'src/utils/merge';
import { addClass } from 'src/utils/dom';
let popupContext;
if (Vue.prototype.$isServer) {
popupContext = global.popupContext || {};
global.popupContext = popupContext;
} else {
popupContext = window.popupContext || {};
window.popupContext = popupContext;
}
popupContext = merge(popupContext, {
hasModal: false,
instances: {},
modalStack: []
});
const getModal = function() {
let modalDom = PopupManager.modalDom;
if (modalDom) {
@@ -40,10 +31,8 @@ const getModal = function() {
};
const PopupManager = {
zIndex: 2000,
nextZIndex() {
return this.zIndex++;
return popupContext.zIndex++;
},
getInstance(id) {