mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
[web-src] Consolidate burger menu handling on route change in router/index.js
This commit is contained in:
parent
79f3faf991
commit
5fff68bb13
@ -182,9 +182,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
'$route' (to, from) {
|
|
||||||
this.$store.commit(types.SHOW_BURGER_MENU, false)
|
|
||||||
},
|
|
||||||
'show_burger_menu' () {
|
'show_burger_menu' () {
|
||||||
if (this.show_burger_menu) {
|
if (this.show_burger_menu) {
|
||||||
document.querySelector('html').classList.add('is-clipped')
|
document.querySelector('html').classList.add('is-clipped')
|
||||||
|
@ -247,10 +247,7 @@ export const router = new VueRouter({
|
|||||||
})
|
})
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (store.state.show_burger_menu) {
|
const burgerMenuVisible = store.state.show_burger_menu
|
||||||
store.commit(types.SHOW_BURGER_MENU, false)
|
store.commit(types.SHOW_BURGER_MENU, false)
|
||||||
next(false)
|
next(!burgerMenuVisible)
|
||||||
} else {
|
|
||||||
next()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user