Timeline changes
This commit is contained in:
parent
defab56afa
commit
196801d67c
2 changed files with 15 additions and 7 deletions
19
www/js/crel.min.js
vendored
19
www/js/crel.min.js
vendored
|
@ -5,19 +5,26 @@ crel.attrMap['on'] = function(element, value) {
|
||||||
element.addEventListener(eventName, value[eventName]);
|
element.addEventListener(eventName, value[eventName]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
crel.attrMap['options'] = function(element, values) {
|
crel.attrMap['options'] = function(element, values, a, b) {
|
||||||
if(element.tagName != "SELECT") {
|
if(element.tagName != "SELECT") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(values);
|
|
||||||
if(Array.isArray(values)) {
|
if(Array.isArray(values)) {
|
||||||
for (let option of values) {
|
for (let option of values) {
|
||||||
element.appendChild(crel('option', option));
|
if(element.value == option) {
|
||||||
|
element.appendChild(crel('option', {'selected': 'selected'}, option));
|
||||||
|
} else {
|
||||||
|
element.appendChild(crel('option', option));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (let option in values) {
|
for (let option in values) {
|
||||||
element.appendChild(crel('option', {'value': option}, values[option]));
|
if(element.value == option) {
|
||||||
|
element.appendChild(crel('option', {'selected': 'selected','value': option}, values[option]));
|
||||||
|
}else{
|
||||||
|
element.appendChild(crel('option', {'value': option}, values[option]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,6 +28,7 @@ class Timeline{
|
||||||
this.dataGroups = new vis.DataSet(groups);
|
this.dataGroups = new vis.DataSet(groups);
|
||||||
let options = {
|
let options = {
|
||||||
maxHeight: '100%',
|
maxHeight: '100%',
|
||||||
|
height: '100%',
|
||||||
margin : {
|
margin : {
|
||||||
item: {
|
item: {
|
||||||
horizontal: 0,
|
horizontal: 0,
|
||||||
|
@ -90,7 +91,7 @@ checkbox.addEventListener('change', (event) => {
|
||||||
console.error( "not a valid message: " + e.data );
|
console.error( "not a valid message: " + e.data );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(msg['action'] == 'status') {
|
if(msg['action'] == 'status') {
|
||||||
for(let hv of msg['hugveys']){
|
for(let hv of msg['hugveys']){
|
||||||
console.log(hv['language'], hv['status']);
|
console.log(hv['language'], hv['status']);
|
||||||
|
|
Loading…
Reference in a new issue