website/js/ntpMenu.js

19 lines
663 B
JavaScript
Raw Normal View History

2021-03-24 22:18:55 +01:00
let Plotly = require('plotly.js-dist')
2021-03-05 19:07:35 +01:00
let ntpNav = document.querySelectorAll(".ntpBanner");
ntpNav.forEach((element) => {
2021-03-24 22:18:55 +01:00
element.onclick = function (){
2021-03-05 20:25:17 +01:00
let index = element.getAttribute("data-index");
let contentID = index + "-Content";
2021-03-24 22:18:55 +01:00
let contentElement = document.getElementById(contentID);
2021-03-05 19:07:35 +01:00
if(contentElement.classList.contains("visible")){
contentElement.classList.remove("visible");
} else {
contentElement.classList.add("visible");
2021-03-05 20:25:17 +01:00
Plotly.relayout(index + "-Delay", {autosize: true});
Plotly.relayout(index + "-Score", {autosize: true});
2021-03-05 19:07:35 +01:00
}
}
});