This commit is contained in:
Jai A
2020-06-09 21:57:52 -07:00
parent 33ee4c36b4
commit 88005c6603
4 changed files with 108 additions and 31 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,5 @@
//TODO Reduce repeated code
let currentlySelected = document.getElementById("description-bar");
let currentlySelectedDiv = document.getElementById("description");
@@ -15,4 +17,40 @@ function toggleSection(element) {
currentlySelectedDiv.classList.add("mod-show");
}
hljs.initHighlightingOnLoad();
let currentlyBuildSelected = document.getElementById("gradle-code-bar");
let currentlyBuildSelectedDiv = document.getElementById("gradle-code");
function toggleBuildSection(element) {
currentlyBuildSelected.classList.remove("mod-bar-active");
currentlyBuildSelected = element;
currentlyBuildSelected.classList.add("mod-bar-active");
currentlyBuildSelectedDiv.classList.remove("mod-show");
currentlyBuildSelectedDiv.classList.add("mod-hide");
currentlyBuildSelectedDiv = document.getElementById(element.id.replace("-bar", ""));
currentlyBuildSelectedDiv.classList.remove("mod-hide");
currentlyBuildSelectedDiv.classList.add("mod-show");
}
let currentlyApiSelected = document.getElementById("curl-code-bar");
let currentlyApiSelectedDiv = document.getElementById("curl-code");
function toggleApiSection(element) {
currentlyApiSelected.classList.remove("mod-bar-active");
currentlyApiSelected = element;
currentlyApiSelected.classList.add("mod-bar-active");
currentlyApiSelectedDiv.classList.remove("mod-show");
currentlyApiSelectedDiv.classList.add("mod-hide");
currentlyApiSelectedDiv = document.getElementById(element.id.replace("-bar", ""));
currentlyApiSelectedDiv.classList.remove("mod-hide");
currentlyApiSelectedDiv.classList.add("mod-show");
}
for (let block of document.getElementsByClassName("api-code-block")) {
hljs.highlightBlock(block);
}