aboutsummaryrefslogtreecommitdiff
path: root/src/client/goldenLayout.js
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2020-11-24 15:59:44 +0530
committerusodhi <61431818+usodhi@users.noreply.github.com>2020-11-24 15:59:44 +0530
commit6899214857b28033e1499251dc4ec32c11649b12 (patch)
tree4c0a5160672c1ef6d8628fdc9838efbb7cd97a00 /src/client/goldenLayout.js
parent86408e6d93fbe6501694371736fe74b81ed39cf3 (diff)
parentd50da6c88585cd6be35aef70ef3df7f565a59ebf (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into acls_uv
Diffstat (limited to 'src/client/goldenLayout.js')
-rw-r--r--src/client/goldenLayout.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client/goldenLayout.js b/src/client/goldenLayout.js
index 293762709..97ce13ae1 100644
--- a/src/client/goldenLayout.js
+++ b/src/client/goldenLayout.js
@@ -3204,7 +3204,16 @@
* If this was the last content item, remove this node as well
*/
} else if (!(this instanceof lm.items.Root) && this.config.isClosable === true) {
- if (!this.parent.parent.isRoot || this.parent.contentItems.length > 1) this.parent.removeChild(this); // bcz: added test for last stack
+ const stack = this;
+ const rowOrCol = stack.parent;
+ const parRowOrCol = rowOrCol.parent;
+ const canDelete = rowOrCol && !rowOrCol.isRoot && (rowOrCol.contentItems.length > 1 || (parRowOrCol && parRowOrCol.contentItems.length > 1)); // bcz: added test for last stack
+ if (canDelete) {
+ rowOrCol.removeChild(stack);
+ if (rowOrCol.contentItems.length === 1 && parRowOrCol.contentItems.length === 1 && !parRowOrCol.isRoot) {
+ parRowOrCol.replaceChild(rowOrCol, rowOrCol.contentItems[0]);
+ }
+ }
}
},