mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-15 10:43:12 +00:00
Create alias for root element
This commit is contained in:
parent
dc933ec911
commit
339590cb2b
1 changed files with 5 additions and 3 deletions
|
|
@ -61,7 +61,9 @@
|
|||
},
|
||||
methods: {
|
||||
removeDialog() {
|
||||
this.$el.parentNode.removeChild(this.$el);
|
||||
if (this.rootElement.contains(this.dialogElement)) {
|
||||
this.$el.parentNode.removeChild(this.$el);
|
||||
}
|
||||
},
|
||||
calculateDialogPos(ref) {
|
||||
const reference = document.querySelector(ref);
|
||||
|
|
@ -79,7 +81,7 @@
|
|||
}
|
||||
},
|
||||
open() {
|
||||
this.$root.$el.appendChild(this.dialogElement);
|
||||
this.rootElement.appendChild(this.dialogElement);
|
||||
this.transitionOff = true;
|
||||
this.calculateDialogPos(this.mdOpenFrom);
|
||||
|
||||
|
|
@ -90,7 +92,7 @@
|
|||
});
|
||||
},
|
||||
close() {
|
||||
if (this.$root.$el.contains(this.dialogElement)) {
|
||||
if (this.rootElement.contains(this.dialogElement)) {
|
||||
let cleanElement = () => {
|
||||
this.dialogInnerElement.removeEventListener(transitionEndEventName, cleanElement);
|
||||
this.$root.$el.removeChild(this.dialogElement);
|
||||
|
|
|
|||
Loading…
Reference in a new issue