diff --git a/www/js/crel.min.js b/www/js/crel.min.js index 739d68c..8675f08 100644 --- a/www/js/crel.min.js +++ b/www/js/crel.min.js @@ -5,19 +5,26 @@ crel.attrMap['on'] = function(element, value) { element.addEventListener(eventName, value[eventName]); } }; -crel.attrMap['options'] = function(element, values) { +crel.attrMap['options'] = function(element, values, a, b) { if(element.tagName != "SELECT") { return; } - console.log(values); if(Array.isArray(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 { 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])); + } } } - -}; \ No newline at end of file + +}; diff --git a/www/js/hugvey_timeline.js b/www/js/hugvey_timeline.js index 0840120..7f83f6f 100644 --- a/www/js/hugvey_timeline.js +++ b/www/js/hugvey_timeline.js @@ -28,6 +28,7 @@ class Timeline{ this.dataGroups = new vis.DataSet(groups); let options = { maxHeight: '100%', + height: '100%', margin : { item: { horizontal: 0, @@ -90,7 +91,7 @@ checkbox.addEventListener('change', (event) => { console.error( "not a valid message: " + e.data ); return; } - + if(msg['action'] == 'status') { for(let hv of msg['hugveys']){ console.log(hv['language'], hv['status']);