Commit a7e7f089 authored by minseok.park's avatar minseok.park

update backdrop click event

parent 74ea2f01
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
z-index: 2; z-index: 2;
} }
.backdrop.is-active{
display: block;
}
.page-versions h2.title { .page-versions h2.title {
color: var(--nav-heading-font-color); color: var(--nav-heading-font-color);
font-size: inherit; font-size: inherit;
......
...@@ -9,15 +9,17 @@ ...@@ -9,15 +9,17 @@
toggle.addEventListener('click', function (e) { toggle.addEventListener('click', function (e) {
selector.classList.toggle('is-active') selector.classList.toggle('is-active')
backdrop.style.display = 'block' backdrop.classList.toggle('is-active')
e.stopPropagation() // trap event e.stopPropagation() // trap event
}) })
backdrop.addEventListener('click', function () { backdrop.addEventListener('click', function () {
selector.classList.remove('is-active') selector.classList.remove('is-active')
backdrop.classList.remove('is-active')
}) })
document.documentElement.addEventListener('click', function () { document.documentElement.addEventListener('click', function () {
selector.classList.remove('is-active') selector.classList.remove('is-active')
backdrop.classList.remove('is-active')
}) })
})() })()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment