Merge pull request #828 from Leopoldthecoder/message-zindex

Message/Notification: manage z-index with PopupManager
pull/835/head
FuryBean 2016-11-04 19:19:32 +08:00 committed by GitHub
commit 92bbc55cd3
4 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import Vue from 'vue'; import Vue from 'vue';
import { PopupManager } from 'vue-popup';
let MessageConstructor = Vue.extend(require('./main.vue')); let MessageConstructor = Vue.extend(require('./main.vue'));
let instance; let instance;
@ -27,6 +28,7 @@ var Message = function(options) {
document.body.appendChild(instance.vm.$el); document.body.appendChild(instance.vm.$el);
instance.vm.visible = true; instance.vm.visible = true;
instance.dom = instance.vm.$el; instance.dom = instance.vm.$el;
instance.dom.style.zIndex = PopupManager.nextZIndex();
instances.push(instance); instances.push(instance);
}; };

View File

@ -1,4 +1,5 @@
import Vue from 'vue'; import Vue from 'vue';
import { PopupManager } from 'vue-popup';
let NotificationConstructor = Vue.extend(require('./main.vue')); let NotificationConstructor = Vue.extend(require('./main.vue'));
let instance; let instance;
@ -22,6 +23,7 @@ var Notification = function(options) {
document.body.appendChild(instance.vm.$el); document.body.appendChild(instance.vm.$el);
instance.vm.visible = true; instance.vm.visible = true;
instance.dom = instance.vm.$el; instance.dom = instance.vm.$el;
instance.dom.style.zIndex = PopupManager.nextZIndex();
let topDist = 0; let topDist = 0;
for (let i = 0, len = instances.length; i < len; i++) { for (let i = 0, len = instances.length; i < len; i++) {

View File

@ -16,7 +16,6 @@
background-color: #fff; background-color: #fff;
transition: opacity 0.3s, transform .4s; transition: opacity 0.3s, transform .4s;
overflow: hidden; overflow: hidden;
z-index: var(--index-popper);
@e group { @e group {
margin-left: 38px; margin-left: 38px;

View File

@ -14,7 +14,6 @@
box-shadow: var(--notification-shadow); box-shadow: var(--notification-shadow);
transition: opacity 0.3s, transform .3s, right .3s, top 0.4s; transition: opacity 0.3s, transform .3s, right .3s, top 0.4s;
overflow: hidden; overflow: hidden;
z-index: var(--index-popper);
@e group { @e group {
& span { & span {