Timeline changes
This commit is contained in:
parent
defab56afa
commit
196801d67c
2 changed files with 15 additions and 7 deletions
15
www/js/crel.min.js
vendored
15
www/js/crel.min.js
vendored
|
@ -5,18 +5,25 @@ 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,
|
||||||
|
|
Loading…
Reference in a new issue