major rework

- modified chartjs for better zoom on touchpad
- flexible number of charts
- handle bool as checkbox
- handle enum as select (pull down menu)
- disable swiper where not needed
and many more
This commit is contained in:
2020-12-23 11:11:22 +01:00
parent 1de819cd26
commit 97c6aa1a87
14 changed files with 2480 additions and 1609 deletions

View File

@ -2,14 +2,12 @@
// % RESPONSIVITY
var nColumns = 1; // Viewport is subdivided in nColumns columns.
var nRows = 1; // Viewport is subdivided in nRows rows.
var gridCountGraphics = 2; // Number of displayed graphics-swipers.
var MINWIDTH = 400; // Minimal width of block.
var MINHEIGHT = 700; // Minimal height of block.
let paramSlider = [0,1,2,3]; // the number of the parameter slider to open
let prevActiveSlider = 0;
function createGrid() {
// Creates grid-elements. By default only the first one is shown
@ -18,7 +16,7 @@ function createGrid() {
var elements = [];
for (var i = 0; i < 4; i++) {
var element = document.createElement('div');
element.setAttribute("class", "grid-element");
element.classList.add("grid-element");
document.getElementById("center").appendChild(element);
elements.push(element);
}
@ -66,6 +64,8 @@ function adjustGrid() {
|| document.body.clientWidth;
var height = window.innerHeight || document.documentElement.clientHeight
|| document.body.clientHeight;
paramSlider = [0,1,2,3];
prevActiveSlider = 0;
switch (nColumns) {
case 1:
@ -134,6 +134,8 @@ function adjustGrid() {
function style(s, width, height) {
if (width) {
paramSlider[prevActiveSlider] = s;
prevActiveSlider = s;
elements[s].style.display = "inline-block";
elements[s].style.width = width;
} else {
@ -145,7 +147,4 @@ function style(s, width, height) {
elements[s].style.float = "left";
}
function isTouchDevice() {
return !!('ontouchstart' in window)
|| !!('msmaxtouchpoints' in window.navigator);
};
let isTouchDevice = !!('ontouchstart' in window) || !!('msmaxtouchpoints' in window.navigator);