website/ts/ntpMenu.ts
2021-03-05 20:25:17 +01:00

17 lines
No EOL
648 B
TypeScript

let ntpNav = document.querySelectorAll(".ntpBanner");
ntpNav.forEach((element) => {
(<HTMLElement>element).onclick = function (){
let index = element.getAttribute("data-index");
let contentID = index + "-Content";
let contentElement = <HTMLElement> document.getElementById(contentID);
if(contentElement.classList.contains("visible")){
contentElement.classList.remove("visible");
} else {
contentElement.classList.add("visible");
Plotly.relayout(index + "-Delay", {autosize: true});
Plotly.relayout(index + "-Score", {autosize: true});
}
}
});