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 <kevin@larke.org>
This commit is contained in:
kevin 2022-12-13 20:54:56 -05:00
parent f3aecb1177
commit 13bc47389b
2 changed files with 11 additions and 8 deletions

View File

@ -18,9 +18,7 @@
<p id="appTitleId">Preset Selection:</p>
<p id="connectTitleId">Disconnected</p>
</div>
<div id="0" class="uiAppDiv">
</div>
</body>
</html>

View File

@ -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;