]> BookStack Code Mirror - website/blob - themes/bookstack/static/js/script.js
Moved website to hugo and merged in blog
[website] / themes / bookstack / static / js / script.js
1
2 // Mobile menu
3
4 var menuButton = document.getElementById('menu-button');
5 var menuDropDown = document.querySelector('header div.inner');
6
7 menuButton.onclick = function(event) {
8     var menuClass = menuDropDown.className;
9     var visible = menuClass.indexOf('showing') !== -1;
10     if (visible) {
11         menuDropDown.className = menuClass.replace('showing', '');
12     } else {
13         menuDropDown.className += ' showing';
14     }
15     event.stopPropagation();
16 };
17
18 document.body.onclick = function(event) {
19     menuDropDown.className = menuDropDown.className.replace('showing', '');
20     event.stopPropagation();
21 };