From c70731ba8301d8bc9ba0d0d1adfa6f4907ef83a3 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Wed, 11 Nov 2020 21:28:31 +0200 Subject: [PATCH] Fix button menu overlay again --- src/components/buttonMenuToggle.ts | 3 +-- src/scss/partials/_button.scss | 13 ++++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/buttonMenuToggle.ts b/src/components/buttonMenuToggle.ts index 5b84ff60..d92c7c6e 100644 --- a/src/components/buttonMenuToggle.ts +++ b/src/components/buttonMenuToggle.ts @@ -17,12 +17,11 @@ const ButtonMenuToggleHandler = (el: HTMLElement) => { if(!el.classList.contains('btn-menu-toggle')) return false; //window.removeEventListener('mousemove', onMouseMove); - let openedMenu = el.querySelector('.btn-menu') as HTMLDivElement; + const openedMenu = el.querySelector('.btn-menu') as HTMLDivElement; e.cancelBubble = true; //cancelEvent(e); if(el.classList.contains('menu-open')) { - el.classList.remove('menu-open'); closeBtnMenu(); } else { openBtnMenu(openedMenu); diff --git a/src/scss/partials/_button.scss b/src/scss/partials/_button.scss index 438f4eb4..944d0e57 100644 --- a/src/scss/partials/_button.scss +++ b/src/scss/partials/_button.scss @@ -148,13 +148,20 @@ } */ &-overlay { position: fixed !important; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 1; + cursor: default; + //background-color: rgba(0, 0, 0, .2); + } + + &-toggle &-overlay { left: -100vw; right: -100vw; top: -100vh; bottom: -100vh; - z-index: 1; - cursor: default; - //background-color: rgba(0, 0, 0, .2); } }