Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overlay #83

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/components/Menu.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div>
<div class="bm-overlay" v-if="isSideBarOpen && !noOverlay" />
<div ref="sideNav" class="bm-menu">
<nav class="bm-item-list">
<slot></slot>
Expand All @@ -13,7 +14,6 @@
<div ref="bmBurgerButton" class="bm-burger-button" @click="openMenu" :class="{ hidden: !burgerIcon }">
<span class="bm-burger-bars line-style" :style="{top:20 * (index * 2) + '%'}" v-for="(x, index) in 3" :key="index"></span>
</div>

</div>
</template>

Expand Down Expand Up @@ -45,7 +45,8 @@
},
noOverlay: {
type: Boolean,
required: false
required: false,
default: false,
},
onStateChange: {
type: Function,
Expand All @@ -72,9 +73,6 @@
this.$emit('openMenu');
this.isSideBarOpen = true;

if (!this.noOverlay) {
document.body.classList.add('bm-overlay');
}
if (this.right) {
this.$refs.sideNav.style.left = 'auto';
this.$refs.sideNav.style.right = '0px';
Expand All @@ -89,7 +87,6 @@
closeMenu() {
this.$emit('closeMenu');
this.isSideBarOpen = false;
document.body.classList.remove('bm-overlay');
this.$refs.sideNav.style.width = '0px';
},

Expand Down Expand Up @@ -193,6 +190,7 @@
left: 36px;
top: 36px;
cursor: pointer;
z-index: 9998;
}
.bm-burger-button.hidden {
display: none;
Expand Down Expand Up @@ -233,10 +231,17 @@
overflow-x: hidden; /* Disable horizontal scroll */
padding-top: 60px; /* Place content 60px from the top */
transition: 0.5s; /*0.5 second transition effect to slide in the sidenav*/
z-index: 9998;
}

.bm-overlay {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.3);
z-index: 9997;
}
.bm-item-list {
color: #b8b7ad;
Expand Down