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

@ -338,7 +338,7 @@ function loadGraphicsMenu(panel){
menuGraphicsPopup.getContainer().style.right = "20px";
panel.appendChild(graphicsMenuControl);
graphicsMenuControl.style.marginLeft="6px";
graphicsMenuControl.style.marginRight="6px";
graphicsMenuControl.style.marginRight="22px";
graphicsMenuControl.style.marginTop="2px";
}
@ -865,7 +865,8 @@ let graphs = (function (){
function jumpToDate(dateTimestampMs, timeValueMs){
cursorLine(null);
window["wideGraphs"] = true;
adjustGrid()
let msLeftTimestampGetVars = 0, msLeftTimestampGetGraph = 0 , msRightTimestampGetVars = 0, msRightTimestampGetGraph = 0;
msLeftTimestampGetVars = dateTimestampMs;
@ -944,6 +945,9 @@ let graphs = (function (){
let msLeftTimestamp = msRightTimestamp - 30*60*1000;
cursorLine(null);
window["wideGraphs"] = false; // will have no effect if hideRightPart is true
adjustGrid();
AJAX("http://" + hostPort + "/getvars").postForm("time=" + msLeftTimestamp/1000 + "," + msRightTimestamp/1000 + "&userconfiguration=" + JSON.stringify(getFormattedUserConfigurationFromLocalStorage()) + "&id="+ clientID).then(function(data){
currentMaxTime = msRightTimestamp + 60000;
currentMinTime = msLeftTimestamp;
@ -982,14 +986,6 @@ let graphs = (function (){
let graphicsPanel = container.parentNode.querySelector('.panel')
graphicsPanel.classList.add('graphics');
graphicsPanel.childNodes[0].style.visibility = "hidden"; // hides the span added by the swippers
// The cross to display "main" panel at the location of the graphs
let gotoMainElm = document.createElement('div');
gotoMainElm.innerHTML = "×";
gotoMainElm.addEventListener('click', function () {
currentSwiper.enableSwiping(true);
console.log("MAIN")
currentSwiper.slideNext();
});
loadExportPopup();
loadCurvesSettingsPopup();
@ -997,12 +993,6 @@ let graphs = (function (){
globalIndicators.loadIndicators(graphicsPanel);
globalControls.loadControls(graphicsPanel);
loadGraphicsMenu(graphicsPanel);
graphicsPanel.appendChild(gotoMainElm);
gotoMainElm.style.marginTop = "auto";
gotoMainElm.style.marginBottom = "auto";
gotoMainElm.style.marginRight = "6px";
gotoMainElm.style.color = "white";
gotoMainElm.style.cursor = "pointer";
if (isTouchDevice) {
doubleTap(removeCursor);