Removed window ref in data, moved init to beforeMount

This commit is contained in:
euvl
2017-06-19 22:23:53 +01:00
parent 85ef8436a7
commit 620d905e29

View File

@@ -147,8 +147,8 @@
},
window: {
width: window.innerWidth,
height: window.innerWidth
width: 0,
height: 0
},
draggableElement: false
@@ -178,7 +178,7 @@
}
}
},
created () {
beforeMount () {
Modal.event.$on('toggle', (name, state, params) => {
if (name === this.name) {
if (typeof state === 'undefined') {
@@ -190,13 +190,11 @@
});
window.addEventListener('resize', this.onWindowResize)
this.onWindowResize()
},
beforeDestroy () {
window.removeEventListener('resize', this.onWindowResize)
},
beforeMount () {
this.onWindowResize()
},
computed: {
position () {
const { window, modal, shift } = this