mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-14 00:10:10 -04:00
[web] Simplify logic of displaying menus
This commit is contained in:
parent
0aedfe1ad4
commit
a4e09b27f4
@ -9,13 +9,13 @@
|
|||||||
@close="pairingActive = false"
|
@close="pairingActive = false"
|
||||||
/>
|
/>
|
||||||
<modal-dialog-update
|
<modal-dialog-update
|
||||||
:show="showUpdateDialog"
|
:show="uiStore.showUpdateDialog"
|
||||||
@close="showUpdateDialog = false"
|
@close="uiStore.showUpdateDialog = false"
|
||||||
/>
|
/>
|
||||||
<list-notifications v-show="!showBurgerMenu" />
|
<list-notifications v-show="!uiStore.showBurgerMenu" />
|
||||||
<navbar-bottom />
|
<navbar-bottom />
|
||||||
<div
|
<div
|
||||||
v-show="showBurgerMenu || showPlayerMenu"
|
v-show="uiStore.showBurgerMenu || uiStore.showPlayerMenu"
|
||||||
class="overlay-fullscreen"
|
class="overlay-fullscreen"
|
||||||
@click="uiStore.hideMenus"
|
@click="uiStore.hideMenus"
|
||||||
/>
|
/>
|
||||||
@ -71,37 +71,11 @@ export default {
|
|||||||
timerId: 0
|
timerId: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
showBurgerMenu: {
|
|
||||||
get() {
|
|
||||||
return this.uiStore.showBurgerMenu
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
this.uiStore.showBurgerMenu = value
|
|
||||||
}
|
|
||||||
},
|
|
||||||
showPlayerMenu: {
|
|
||||||
get() {
|
|
||||||
return this.uiStore.showPlayerMenu
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
this.uiStore.showPlayerMenu = value
|
|
||||||
}
|
|
||||||
},
|
|
||||||
showUpdateDialog: {
|
|
||||||
get() {
|
|
||||||
return this.uiStore.showUpdateDialog
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
this.uiStore.showUpdateDialog = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
showBurgerMenu() {
|
'uiStore.showBurgerMenu'() {
|
||||||
this.updateClipping()
|
this.updateClipping()
|
||||||
},
|
},
|
||||||
showPlayerMenu() {
|
'uiStore.showPlayerMenu'() {
|
||||||
this.updateClipping()
|
this.updateClipping()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -109,6 +83,7 @@ export default {
|
|||||||
this.connect()
|
this.connect()
|
||||||
// Hook the progress bar to start before we move router-view
|
// Hook the progress bar to start before we move router-view
|
||||||
this.$router.beforeEach((to, from, next) => {
|
this.$router.beforeEach((to, from, next) => {
|
||||||
|
this.updateClipping()
|
||||||
if (!(to.path === from.path && to.hash)) {
|
if (!(to.path === from.path && to.hash)) {
|
||||||
if (to.meta.progress) {
|
if (to.meta.progress) {
|
||||||
this.$Progress.parseMeta(to.meta.progress)
|
this.$Progress.parseMeta(to.meta.progress)
|
||||||
@ -255,7 +230,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateClipping() {
|
updateClipping() {
|
||||||
if (this.showBurgerMenu || this.showPlayerMenu) {
|
if (this.uiStore.showBurgerMenu || this.uiStore.showPlayerMenu) {
|
||||||
document.querySelector('html').classList.add('is-clipped')
|
document.querySelector('html').classList.add('is-clipped')
|
||||||
} else {
|
} else {
|
||||||
document.querySelector('html').classList.remove('is-clipped')
|
document.querySelector('html').classList.remove('is-clipped')
|
||||||
|
@ -39,7 +39,6 @@ import PageSettingsArtwork from '@/pages/PageSettingsArtwork.vue'
|
|||||||
import PageSettingsOnlineServices from '@/pages/PageSettingsOnlineServices.vue'
|
import PageSettingsOnlineServices from '@/pages/PageSettingsOnlineServices.vue'
|
||||||
import PageSettingsRemotesOutputs from '@/pages/PageSettingsRemotesOutputs.vue'
|
import PageSettingsRemotesOutputs from '@/pages/PageSettingsRemotesOutputs.vue'
|
||||||
import PageSettingsWebinterface from '@/pages/PageSettingsWebinterface.vue'
|
import PageSettingsWebinterface from '@/pages/PageSettingsWebinterface.vue'
|
||||||
import { useUIStore } from '@/stores/ui'
|
|
||||||
|
|
||||||
const TOP_WITH_TABS = 100
|
const TOP_WITH_TABS = 100
|
||||||
|
|
||||||
@ -267,18 +266,3 @@ export const router = createRouter({
|
|||||||
return { left: 0, top: 0 }
|
return { left: 0, top: 0 }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
|
||||||
const uiStore = useUIStore()
|
|
||||||
if (uiStore.showBurgerMenu) {
|
|
||||||
uiStore.showBurgerMenu = false
|
|
||||||
next(false)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (uiStore.showPlayerMenu) {
|
|
||||||
uiStore.showPlayerMenu = false
|
|
||||||
next(false)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
next(true)
|
|
||||||
})
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user