Hide menu when navigating page
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2022-12-05 00:04:01 +01:00
parent 1ab866a2fe
commit be3336a18d
2 changed files with 10 additions and 0 deletions

3
resources/js/app.js vendored
View File

@ -1,5 +1,6 @@
import Vue from 'vue';
import {App as InertiaApp, plugin, Link as ILink} from '@inertiajs/inertia-vue';
import {Inertia} from '@inertiajs/inertia';
import SvgSprite from './components/SvgSprite.js';
import VPages from './components/VPages.vue';
@ -32,6 +33,8 @@ const el = document.getElementById('app');
Vue.mixin(hasModule);
Vue.component('ILink', ILink);
Inertia.on('start', (event) => window.dispatchEvent(new Event('inertiaStart')));
new Vue({
render: (h) =>
h(InertiaApp, {

View File

@ -150,8 +150,15 @@ export default {
},
},
created() {
var _self = this;
window.addEventListener('resize', this.menuListener);
this.menuListener();
window.addEventListener('inertiaStart', (e) => {
_self.menuVisible = false;
_self.searchVisible = false;
_self.menuOverflowVisible = false;
});
},
};
</script>