Fix Sidebar menu on mobile RTL

Fix collapsable menu on mobile
This commit is contained in:
cristij 2018-10-18 16:31:22 +03:00
parent 8d1fc33d13
commit 15b46a2e13
2 changed files with 17 additions and 12 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<div :class="{'nav-open': $sidebar.showSidebar}"> <div>
<notifications></notifications> <notifications></notifications>
<router-view :key="$route.fullPath"></router-view> <router-view :key="$route.fullPath"></router-view>
</div> </div>
@ -12,10 +12,15 @@ export default {
if (!this.$rtl.isRTL) { if (!this.$rtl.isRTL) {
this.$rtl.disableRTL(); this.$rtl.disableRTL();
} }
},
toggleNavOpen() {
let root = document.getElementsByTagName('html')[0];
root.classList.toggle('nav-open');
} }
}, },
mounted() { mounted() {
this.$watch('$route', this.disableRTL, { immediate: true }); this.$watch('$route', this.disableRTL, { immediate: true });
this.$watch('$sidebar.showSidebar', this.toggleNavOpen)
} }
}; };
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<nav class="navbar navbar-expand-lg navbar-absolute navbar-transparent" <nav class="navbar navbar-expand-lg navbar-absolute"
:class="{'bg-white': showMenu}"> :class="{'bg-white': showMenu}">
<div class="container-fluid"> <div class="container-fluid">
<div class="navbar-wrapper"> <div class="navbar-wrapper">