From 741ed3f9b411deefed25e3a906dfe3c4df3c6be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Espeute?= Date: Wed, 22 Jan 2025 10:01:46 +0100 Subject: [PATCH] [scene] Fix tree style not getting applied sometimes --- hide/comp/IconTree.hx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hide/comp/IconTree.hx b/hide/comp/IconTree.hx index 63988330..36d5858c 100644 --- a/hide/comp/IconTree.hx +++ b/hide/comp/IconTree.hx @@ -138,6 +138,7 @@ class IconTree extends Component { } return false; }, + worker : false, data : function(obj, callb) { if( !inInit && checkRemoved() ) return; @@ -197,15 +198,21 @@ class IconTree extends Component { onMove(getVal(e.node.id), e.parent == "#" ? null : getVal(e.parent), e.position); }); element.on('ready.jstree', function () { - /* var lis = element.find("li"); + var lis = element.find("li"); for(li in lis) { var item = map.get(li.id); if(item != null) applyStyle(getValue(item), new Element(li)); - } */ + } }); element.on('changed.jstree', function (e, data) { var nodes: Array = data.changed.deselected; + + // desselect all is called when the tree is refreshed, + // so we highjack it to refresh the whole tree + if (data.action == "deselect_all") { + nodes = [for (i in element.find("li").toArray()) i.id]; + } for(id in nodes) { var item = getVal(id); var el = getElement(item);