From 9524b954b47f996719f03118f127b2b89f09bd04 Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 21 Sep 2024 17:20:12 -0400 Subject: [PATCH] ui.js : Added ui_empty(). --- src/caw/html/js/ui.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/caw/html/js/ui.js b/src/caw/html/js/ui.js index 5d3031d..d0e8ddd 100644 --- a/src/caw/html/js/ui.js +++ b/src/caw/html/js/ui.js @@ -1072,6 +1072,25 @@ function ui_destroy( d ) ele.parentElement.removeChild( ele ) } +// Remove all children from the selected element +function ui_empty( d ) +{ + var ele = dom_id_to_ele(d.uuId.toString()) + + if( ele == null ) + console.log("ele to empty not found"); + + if( ele != null) + { + let i = 0; + let n = ele.children.length; + for(i=0; i