diff options
Diffstat (limited to 'plugins/base/src/main/resources/dokka/scripts')
| -rw-r--r-- | plugins/base/src/main/resources/dokka/scripts/platformContentHandler.js | 15 | ||||
| -rw-r--r-- | plugins/base/src/main/resources/dokka/scripts/scripts.js | 17 |
2 files changed, 15 insertions, 17 deletions
diff --git a/plugins/base/src/main/resources/dokka/scripts/platformContentHandler.js b/plugins/base/src/main/resources/dokka/scripts/platformContentHandler.js index 78d65333..bc34d6a6 100644 --- a/plugins/base/src/main/resources/dokka/scripts/platformContentHandler.js +++ b/plugins/base/src/main/resources/dokka/scripts/platformContentHandler.js @@ -17,8 +17,23 @@ window.addEventListener('load', () => { } initTabs() handleAnchor() + initHidingLeftNavigation() }) +const initHidingLeftNavigation = () => { + document.getElementById("leftToggler").onclick = function(event) { + //Events need to be prevented from bubbling since they will trigger next handler + event.preventDefault(); + event.stopPropagation(); + event.stopImmediatePropagation(); + document.getElementById("leftColumn").classList.toggle("open"); + } + + document.getElementById("main").onclick = () => { + document.getElementById("leftColumn").classList.remove("open"); + } +} + // Hash change is needed in order to allow for linking inside the same page with anchors // If this is not present user is forced to refresh the site in order to use an anchor window.onhashchange = handleAnchor diff --git a/plugins/base/src/main/resources/dokka/scripts/scripts.js b/plugins/base/src/main/resources/dokka/scripts/scripts.js deleted file mode 100644 index 85dfd86f..00000000 --- a/plugins/base/src/main/resources/dokka/scripts/scripts.js +++ /dev/null @@ -1,17 +0,0 @@ -document.getElementById("navigationFilter").oninput = function (e) { - var input = e.target.value; - var menuParts = document.getElementsByClassName("sideMenuPart") - for (let part of menuParts) { - if(part.querySelector("a").textContent.startsWith(input)) { - part.classList.remove("filtered"); - } else { - part.classList.add("filtered"); - } - } -} - -window.addEventListener("DOMContentLoaded", () => { - document.getElementById("leftToggler").onclick = function() { - document.getElementById("leftColumn").classList.toggle("open"); - } -}
\ No newline at end of file |
