Changed graphics panel (stick to right) + corrected month in date indicator
This commit is contained in:
@ -27,7 +27,7 @@ class DatesIndicator extends HTMLElement{
|
|||||||
let date = new Date(timestamp);
|
let date = new Date(timestamp);
|
||||||
let dayName = this.dayNumberToName(date.getDay());
|
let dayName = this.dayNumberToName(date.getDay());
|
||||||
let day = date.getDate();
|
let day = date.getDate();
|
||||||
let month = date.getMonth();
|
let month = date.getMonth() + 1; //getMonth returns number between 0 and 1
|
||||||
let year = date.getFullYear();
|
let year = date.getFullYear();
|
||||||
|
|
||||||
return dayName + ", " + day.toString().padStart(2, "0") + "/" + month.toString().padStart(2, "0") + "/" + year ;
|
return dayName + ", " + day.toString().padStart(2, "0") + "/" + month.toString().padStart(2, "0") + "/" + year ;
|
||||||
|
@ -2,10 +2,6 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel.graphics{
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel.graphics span:first-child{
|
.panel.graphics span:first-child{
|
||||||
display: none;
|
display: none;
|
||||||
@ -29,7 +25,6 @@
|
|||||||
padding-right: 12px;
|
padding-right: 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
column-gap: 5px;
|
column-gap: 5px;
|
||||||
margin-left: 120px;
|
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,19 +21,23 @@
|
|||||||
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
||||||
/* PANEL */
|
/* PANEL */
|
||||||
.panel {
|
.panel {
|
||||||
text-align: center;
|
|
||||||
background-color: #303030;
|
background-color: #303030;
|
||||||
color: white;
|
color: white;
|
||||||
/* padding: 6px 6px 6px 6px; */
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
.panel:not(.graphics) {
|
.panel:not(.graphics) {
|
||||||
|
text-align: center;
|
||||||
padding: 6px 6px 6px 6px;
|
padding: 6px 6px 6px 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.panel.graphics{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
.slide-close-icon {
|
.slide-close-icon {
|
||||||
transition: 0.4s;
|
transition: 0.4s;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -961,13 +961,27 @@ let graphs = (function (){
|
|||||||
|
|
||||||
let graphicsPanel = container.parentNode.querySelector('.panel')
|
let graphicsPanel = container.parentNode.querySelector('.panel')
|
||||||
graphicsPanel.classList.add('graphics');
|
graphicsPanel.classList.add('graphics');
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
});
|
||||||
|
|
||||||
if(!created){
|
if(!created){
|
||||||
globalControls.loadControls(graphicsPanel);
|
|
||||||
globalIndicators.loadIndicators(graphicsPanel);
|
globalIndicators.loadIndicators(graphicsPanel);
|
||||||
|
globalControls.loadControls(graphicsPanel);
|
||||||
|
graphicsPanel.appendChild(gotoMainElm);
|
||||||
|
gotoMainElm.style.marginTop = "auto";
|
||||||
|
gotoMainElm.style.marginBottom = "auto";
|
||||||
|
gotoMainElm.style.marginRight = "6px";
|
||||||
|
gotoMainElm.style.marginLeft = "6px";
|
||||||
|
created = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// gotoNowElm.addEventListener('click', gotoNow);
|
// gotoNowElm.addEventListener('click', gotoNow);
|
||||||
//gotoNowElm.innerHTML = "go to now";
|
//gotoNowElm.innerHTML = "go to now";
|
||||||
// container.parentNode.querySelector('.panel span').appendChild(gotoNowElm);
|
// container.parentNode.querySelector('.panel span').appendChild(gotoNowElm);
|
||||||
@ -1013,9 +1027,6 @@ let graphs = (function (){
|
|||||||
// container.parentNode.querySelector('.panel span').appendChild(zoomMode);
|
// container.parentNode.querySelector('.panel span').appendChild(zoomMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The cross to display "main" panel at the location of the graphs
|
|
||||||
let gotoMainElm = document.createElement('div');
|
|
||||||
gotoMainElm.innerHTML = "×";
|
|
||||||
let currentSwiper = swiper[f];
|
let currentSwiper = swiper[f];
|
||||||
|
|
||||||
function setSlidingMode(mode) {
|
function setSlidingMode(mode) {
|
||||||
@ -1027,16 +1038,7 @@ let graphs = (function (){
|
|||||||
currentSwiper.enableSwiping(false);
|
currentSwiper.enableSwiping(false);
|
||||||
})
|
})
|
||||||
|
|
||||||
gotoMainElm.addEventListener('click', function () {
|
|
||||||
currentSwiper.enableSwiping(true);
|
|
||||||
console.log("MAIN")
|
|
||||||
currentSwiper.slideNext();
|
|
||||||
});
|
|
||||||
// container.parentNode.querySelector('.panel span').appendChild(gotoMainElm);
|
// container.parentNode.querySelector('.panel span').appendChild(gotoMainElm);
|
||||||
if(!created){
|
|
||||||
graphicsPanel.appendChild(gotoMainElm);
|
|
||||||
created = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user