forked from platypush/platypush
[UI] Keep track of the number of stack modals.
This commit is contained in:
parent
6dd1d481d5
commit
0d0665ca7c
1 changed files with 13 additions and 2 deletions
|
@ -56,6 +56,7 @@ export default {
|
||||||
pwaInstallEvent: null,
|
pwaInstallEvent: null,
|
||||||
initialized: false,
|
initialized: false,
|
||||||
initError: null,
|
initError: null,
|
||||||
|
stackedModals: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -83,7 +84,7 @@ export default {
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onNotification(notification) {
|
onNotification(notification) {
|
||||||
this.$refs.notifications.create(notification)
|
this.$refs.notifications?.create(notification)
|
||||||
},
|
},
|
||||||
|
|
||||||
async initConfig() {
|
async initConfig() {
|
||||||
|
@ -100,7 +101,15 @@ export default {
|
||||||
this.pwaInstallEvent.prompt()
|
this.pwaInstallEvent.prompt()
|
||||||
|
|
||||||
this.$refs.pwaDialog.close()
|
this.$refs.pwaDialog.close()
|
||||||
}
|
},
|
||||||
|
|
||||||
|
onModalClose() {
|
||||||
|
this.stackedModals = Math.max(0, this.stackedModals - 1)
|
||||||
|
},
|
||||||
|
|
||||||
|
onModalOpen() {
|
||||||
|
this.stackedModals++
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
|
@ -136,6 +145,8 @@ export default {
|
||||||
bus.onNotification(this.onNotification)
|
bus.onNotification(this.onNotification)
|
||||||
bus.on('connect', () => this.connected = true)
|
bus.on('connect', () => this.connected = true)
|
||||||
bus.on('disconnect', () => this.connected = false)
|
bus.on('disconnect', () => this.connected = false)
|
||||||
|
bus.on('modal-open', this.onModalOpen)
|
||||||
|
bus.on('modal-close', this.onModalClose)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue