From 13bc47389bd20e91f2ee8060e72a0053926bc020 Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 13 Dec 2022 20:54:56 -0500 Subject: [PATCH] html/preset_sel/index.html, js/ui.js : The main app. div is now created rather than statically constructed. Fixed bug where the values of numbers without min/max ranges were not updated correctly. Fixed bug where elements with 'order' attribute were not ordered correctly when created. Signed-off-by: kevin --- html/preset_sel/index.html | 6 ++---- html/preset_sel/js/ui.js | 13 +++++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/html/preset_sel/index.html b/html/preset_sel/index.html index 95738d9..a85daaa 100644 --- a/html/preset_sel/index.html +++ b/html/preset_sel/index.html @@ -18,9 +18,7 @@

Preset Selection:

Disconnected

- -
-
- + + diff --git a/html/preset_sel/js/ui.js b/html/preset_sel/js/ui.js index 9736f02..3cd92d0 100644 --- a/html/preset_sel/js/ui.js +++ b/html/preset_sel/js/ui.js @@ -328,9 +328,9 @@ function ui_create_ele( parent_ele, ele_type, d, dfltClassName ) //console.log("Created: " + ele_type + " parent:" + d.parentUuId + " id:" + ele.id + " appId:" + ele.appId) parent_ele.appendChild(ele); - - + if( d.hasOwnProperty('order') ) + ui_set_order_key(ele,d.order) } return ele @@ -683,7 +683,10 @@ function _ui_set_number_range( ele, d ) function ui_set_number_value( ele, value ) { - if( ele.minValue <= value && value <= ele.maxValue ) + var min_ok_fl = (!ele.hasOwnProperty('minValue')) || (value >= ele.minValue) + var max_ok_fl = (!ele.hasOwnProperty('maxValue')) || (value <= ele.maxValue) + + if( min_ok_fl && max_ok_fl ) { ele.value = value; if( ele.decpl == 0 ) @@ -1252,7 +1255,9 @@ function ws_form_url(urlSuffix) function main() { - rootEle = dom_id_to_ele(_rootId); + d = { "className":"uiAppDiv", "uuId":_rootId } + rootEle = ui_create_div( document.body, d ) + //rootEle = dom_id_to_ele(_rootId); rootEle.uuId = 0; rootEle.id = _nextEleId; _nextEleId += 1;