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:
@ -72,6 +72,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="center"></div>
|
<div id="center"></div>
|
||||||
|
<div id="close-cross">×</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -127,3 +127,15 @@ meta, body {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: solid 4px dimgray;
|
border: solid 4px dimgray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
||||||
|
/* CLOSE CROSS */
|
||||||
|
|
||||||
|
#close-cross{
|
||||||
|
z-index: 50;
|
||||||
|
top: 9px;
|
||||||
|
right: 12px;
|
||||||
|
position: fixed;
|
||||||
|
color: white;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
@ -338,7 +338,7 @@ function loadGraphicsMenu(panel){
|
|||||||
menuGraphicsPopup.getContainer().style.right = "20px";
|
menuGraphicsPopup.getContainer().style.right = "20px";
|
||||||
panel.appendChild(graphicsMenuControl);
|
panel.appendChild(graphicsMenuControl);
|
||||||
graphicsMenuControl.style.marginLeft="6px";
|
graphicsMenuControl.style.marginLeft="6px";
|
||||||
graphicsMenuControl.style.marginRight="6px";
|
graphicsMenuControl.style.marginRight="22px";
|
||||||
graphicsMenuControl.style.marginTop="2px";
|
graphicsMenuControl.style.marginTop="2px";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -865,7 +865,8 @@ let graphs = (function (){
|
|||||||
function jumpToDate(dateTimestampMs, timeValueMs){
|
function jumpToDate(dateTimestampMs, timeValueMs){
|
||||||
|
|
||||||
cursorLine(null);
|
cursorLine(null);
|
||||||
|
window["wideGraphs"] = true;
|
||||||
|
adjustGrid()
|
||||||
let msLeftTimestampGetVars = 0, msLeftTimestampGetGraph = 0 , msRightTimestampGetVars = 0, msRightTimestampGetGraph = 0;
|
let msLeftTimestampGetVars = 0, msLeftTimestampGetGraph = 0 , msRightTimestampGetVars = 0, msRightTimestampGetGraph = 0;
|
||||||
|
|
||||||
msLeftTimestampGetVars = dateTimestampMs;
|
msLeftTimestampGetVars = dateTimestampMs;
|
||||||
@ -944,6 +945,9 @@ let graphs = (function (){
|
|||||||
let msLeftTimestamp = msRightTimestamp - 30*60*1000;
|
let msLeftTimestamp = msRightTimestamp - 30*60*1000;
|
||||||
cursorLine(null);
|
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){
|
AJAX("http://" + hostPort + "/getvars").postForm("time=" + msLeftTimestamp/1000 + "," + msRightTimestamp/1000 + "&userconfiguration=" + JSON.stringify(getFormattedUserConfigurationFromLocalStorage()) + "&id="+ clientID).then(function(data){
|
||||||
currentMaxTime = msRightTimestamp + 60000;
|
currentMaxTime = msRightTimestamp + 60000;
|
||||||
currentMinTime = msLeftTimestamp;
|
currentMinTime = msLeftTimestamp;
|
||||||
@ -982,14 +986,6 @@ let graphs = (function (){
|
|||||||
let graphicsPanel = container.parentNode.querySelector('.panel')
|
let graphicsPanel = container.parentNode.querySelector('.panel')
|
||||||
graphicsPanel.classList.add('graphics');
|
graphicsPanel.classList.add('graphics');
|
||||||
graphicsPanel.childNodes[0].style.visibility = "hidden"; // hides the span added by the swippers
|
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();
|
loadExportPopup();
|
||||||
loadCurvesSettingsPopup();
|
loadCurvesSettingsPopup();
|
||||||
@ -997,12 +993,6 @@ let graphs = (function (){
|
|||||||
globalIndicators.loadIndicators(graphicsPanel);
|
globalIndicators.loadIndicators(graphicsPanel);
|
||||||
globalControls.loadControls(graphicsPanel);
|
globalControls.loadControls(graphicsPanel);
|
||||||
loadGraphicsMenu(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) {
|
if (isTouchDevice) {
|
||||||
doubleTap(removeCursor);
|
doubleTap(removeCursor);
|
||||||
|
@ -76,7 +76,8 @@ new Settings()
|
|||||||
.treat("showConsole", "sc", to_bool, true)
|
.treat("showConsole", "sc", to_bool, true)
|
||||||
.treat("showOverview", "so", to_bool, true)
|
.treat("showOverview", "so", to_bool, true)
|
||||||
.treat("showGraphics", "sg", to_bool, true) // false)
|
.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)
|
.treat("showAsync", "sa", to_bool, false)
|
||||||
|
|
||||||
function loadFirstBlocks() {
|
function loadFirstBlocks() {
|
||||||
@ -130,6 +131,24 @@ window.onload = function() {
|
|||||||
// Determine size of grid-elements depending on number of columns 'm' and
|
// Determine size of grid-elements depending on number of columns 'm' and
|
||||||
// rows 'n'
|
// rows 'n'
|
||||||
adjustGrid();
|
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.
|
// Create swiper-instances.
|
||||||
for (var s = 0; s < MAXBLOCK; s++) {
|
for (var s = 0; s < MAXBLOCK; s++) {
|
||||||
swiper[s] = insertSwiper(s);
|
swiper[s] = insertSwiper(s);
|
||||||
|
@ -67,7 +67,7 @@ function adjustGrid() {
|
|||||||
paramSlider = [0,1,2,3];
|
paramSlider = [0,1,2,3];
|
||||||
prevActiveSlider = 0;
|
prevActiveSlider = 0;
|
||||||
|
|
||||||
if (window["hideRightPart"]){
|
if (window["hideRightPart"] || window["wideGraphs"]){
|
||||||
style(0,"100vw","100vh");
|
style(0,"100vw","100vh");
|
||||||
style(1); // hide
|
style(1); // hide
|
||||||
style(2); // hide
|
style(2); // hide
|
||||||
|
Reference in New Issue
Block a user