Graphs cross now always top right hand corner, hides/shows right part on click, jump hides right part, goToNow shows right part

This commit is contained in:
l_samenv
2024-09-06 15:54:41 +02:00
parent 5cf19f99d0
commit 400899643b
5 changed files with 40 additions and 18 deletions

View File

@@ -76,7 +76,8 @@ new Settings()
.treat("showConsole", "sc", to_bool, true)
.treat("showOverview", "so", to_bool, true)
.treat("showGraphics", "sg", to_bool, true) // false)
.treat("hideRightPart", "hr", to_bool, false)
.treat("hideRightPart", "hr", to_bool, false) //used to completely disable the right part
.treat("wideGraphs", "wg", to_bool, false) //used to toggle the size of the graphs part
.treat("showAsync", "sa", to_bool, false)
function loadFirstBlocks() {
@@ -130,6 +131,24 @@ window.onload = function() {
// Determine size of grid-elements depending on number of columns 'm' and
// rows 'n'
adjustGrid();
let crossElement = document.getElementById("close-cross");
if(window["hideRightPart"]){
document.body.removeChild(crossElement);
}else{
crossElement.onclick = function(){
if(nColumns == 1){ // if the screen is small, the cross always slides to the next slide
let someSwiper = swiper[0];
someSwiper.enableSwiping(true); // needed because someSwiper might be the graphs swiper, and swiping is disable by default
someSwiper.slideNext(); // someSwiper can be anything, it will swipe to the next slide
}else{ // else it toggles the graphs window's size and triggers the adjustGrid()
window["wideGraphs"] = !window['wideGraphs'];
adjustGrid();
}
}
}
// Create swiper-instances.
for (var s = 0; s < MAXBLOCK; s++) {
swiper[s] = insertSwiper(s);