Add width listener for responsive conditional rendering
This commit is contained in:
parent
189166ec7c
commit
c908eaa1cd
|
@ -67,6 +67,7 @@ export default {
|
||||||
showShortcutsModal: false,
|
showShortcutsModal: false,
|
||||||
showSetInstanceModal: false,
|
showSetInstanceModal: false,
|
||||||
initialTitle: document.title,
|
initialTitle: document.title,
|
||||||
|
width: window.innerWidth
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created () {
|
async created () {
|
||||||
|
@ -82,7 +83,8 @@ export default {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
window.addEventListener('resize', this.handleResize);
|
||||||
|
this.handleResize();
|
||||||
this.openWebsocket()
|
this.openWebsocket()
|
||||||
let self = this
|
let self = this
|
||||||
if (!this.$store.state.ui.selectedLanguage) {
|
if (!this.$store.state.ui.selectedLanguage) {
|
||||||
|
@ -293,6 +295,9 @@ export default {
|
||||||
this.$store.commit('ui/serviceWorker', {updateAvailable: false})
|
this.$store.commit('ui/serviceWorker', {updateAvailable: false})
|
||||||
if (!this.serviceWorker.registration || !this.serviceWorker.registration.waiting) { return; }
|
if (!this.serviceWorker.registration || !this.serviceWorker.registration.waiting) { return; }
|
||||||
this.serviceWorker.registration.waiting.postMessage({command: 'skipWaiting'})
|
this.serviceWorker.registration.waiting.postMessage({command: 'skipWaiting'})
|
||||||
|
},
|
||||||
|
handleResize() {
|
||||||
|
this.width = window.innerWidth
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
Loading…
Reference in New Issue