Fixed #167 - Dialog visuals broken when initially displayed

pull/201/head
mertsincan 2020-01-30 11:03:03 +03:00
parent 805f352b04
commit 44a29f57a0
1 changed files with 16 additions and 10 deletions

View File

@ -64,21 +64,15 @@ export default {
},
documentKeydownListener: null,
updated() {
if (this.$refs.mask) {
this.dialogClasses = this.$vnode.data.class;
this.dialogStyles = this.$vnode.data.style;
DomHandler.removeClass(this.$refs.mask, this.$vnode.data.class);
if (this.$vnode.data.style) {
Object.keys(this.$vnode.data.style).forEach((key) => {
this.$refs.mask.style[key] = '';
});
}
}
this.removeStylesFromMask();
if (this.visible && !this.maskVisible) {
this.maskVisible = true;
}
},
mounted() {
this.removeStylesFromMask();
},
beforeDestroy() {
this.disableModality();
},
@ -165,6 +159,18 @@ export default {
window.document.removeEventListener('keydown', this.documentKeydownListener);
this.documentKeydownListener = null;
}
},
removeStylesFromMask() {
if (this.$refs.mask) {
this.dialogClasses = this.$vnode.data.class;
this.dialogStyles = this.$vnode.data.style;
DomHandler.removeClass(this.$refs.mask, this.$vnode.data.class);
if (this.$vnode.data.style) {
Object.keys(this.$vnode.data.style).forEach((key) => {
this.$refs.mask.style[key] = '';
});
}
}
}
},
computed: {