Skip to content

Commit

Permalink
fix deletion of group
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroyasuNishiyama committed May 23, 2020
1 parent 82b3a97 commit c5ca9fa
Showing 1 changed file with 16 additions and 2 deletions.
Expand Up @@ -362,6 +362,9 @@ RED.sidebar.info.outliner = (function() {
var existingObject = objects[n.id];
var parent = n.g||n.z;

if (!existingObject) {
return;
}
var nodeLabelText = getNodeLabelText(n);
if (nodeLabelText) {
existingObject.element.find(".red-ui-info-outline-item-label").text(nodeLabelText);
Expand All @@ -370,7 +373,9 @@ RED.sidebar.info.outliner = (function() {
}

if (parent !== existingObject.parent.id) {
existingObject.treeList.remove();
if (existingObject.treeList) {
existingObject.treeList.remove();
}
if (!parent) {
globalConfigNodes.treeList.addChild(existingObject);
} else {
Expand All @@ -386,11 +391,20 @@ RED.sidebar.info.outliner = (function() {
function onObjectRemove(n) {
var existingObject = objects[n.id];
existingObject.treeList.remove();
delete objects[n.d]
delete objects[n.id]
var parent = existingObject.parent;
if (parent.children.length === 0) {
parent.treeList.addChild(getEmptyItem(parent.id));
}
if (existingObject.children && (existingObject.children.length > 0)) {
existingObject.children.forEach(function (nc) {
if (!nc.empty) {
var childObject = objects[nc.id];
nc.parent = parent;
objects[parent.id].treeList.addChild(childObject);
}
});
}
}
function getGutter(n) {
var span = $("<span>",{class:"red-ui-info-outline-gutter"});
Expand Down

0 comments on commit c5ca9fa

Please sign in to comment.