1
0
mirror of https://github.com/lancedikson/bowser synced 2026-03-02 03:40:27 +00:00

docs(bowser): auto-generate docs

This commit is contained in:
Denis Demchenko
2019-07-16 22:21:01 +03:00
parent dcadd16ed7
commit f3c6029f0f
13 changed files with 802 additions and 210 deletions

View File

@@ -1,11 +1,20 @@
function hideAllButCurrent(){
//by default all submenut items are hidden
$("nav > ul > li > ul li").hide();
//but we need to rehide them for search
document.querySelectorAll("nav > ul > li > ul li").forEach(function(parent) {
parent.style.display = "none";
});
//only current page (if it exists) should be opened
var file = window.location.pathname.split("/").pop();
$("nav > ul > li > a[href^='"+file+"']").parent().find("> ul li").show();
var file = window.location.pathname.split("/").pop().replace(/\.html/, '');
document.querySelectorAll("nav > ul > li > a").forEach(function(parent) {
var href = parent.attributes.href.value.replace(/\.html/, '');
if (file === href) {
parent.parentNode.querySelectorAll("ul li").forEach(function(elem) {
elem.style.display = "block";
});
}
});
}
$( document ).ready(function() {
hideAllButCurrent();
});
hideAllButCurrent();