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, documentKeydownListener: null,
updated() { updated() {
if (this.$refs.mask) { this.removeStylesFromMask();
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] = '';
});
}
}
if (this.visible && !this.maskVisible) { if (this.visible && !this.maskVisible) {
this.maskVisible = true; this.maskVisible = true;
} }
}, },
mounted() {
this.removeStylesFromMask();
},
beforeDestroy() { beforeDestroy() {
this.disableModality(); this.disableModality();
}, },
@ -165,6 +159,18 @@ export default {
window.document.removeEventListener('keydown', this.documentKeydownListener); window.document.removeEventListener('keydown', this.documentKeydownListener);
this.documentKeydownListener = null; 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: { computed: {