Skip to content

Commit

Permalink
[scene] Fix tree style not getting applied sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
EspeuteClement committed Jan 22, 2025
1 parent 29a7bc2 commit 741ed3f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hide/comp/IconTree.hx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class IconTree<T:{}> extends Component {
}
return false;
},
worker : false,
data : function(obj, callb) {
if( !inInit && checkRemoved() )
return;
Expand Down Expand Up @@ -197,15 +198,21 @@ class IconTree<T:{}> 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<Dynamic> = 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);
Expand Down

0 comments on commit 741ed3f

Please sign in to comment.