mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 07:05:57 -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: {
|
||||
'$route' (to, from) {
|
||||
this.$store.commit(types.SHOW_BURGER_MENU, false)
|
||||
},
|
||||
'show_burger_menu' () {
|
||||
if (this.show_burger_menu) {
|
||||
document.querySelector('html').classList.add('is-clipped')
|
||||
|
@ -247,10 +247,7 @@ export const router = new VueRouter({
|
||||
})
|
||||
|
||||
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)
|
||||
next(false)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
next(!burgerMenuVisible)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user