aboutsummaryrefslogtreecommitdiff
path: root/src/client/goldenLayout.js
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-11-21 20:39:00 -0500
committerbobzel <zzzman@gmail.com>2020-11-21 20:39:00 -0500
commit4835cefd9cab01de2ffd9f9ceb0962dc99b00928 (patch)
treea2d6063e472376a3218c9204449140225b31e89f /src/client/goldenLayout.js
parent9a40f051dd1630c0c1675353a420bd524601b505 (diff)
fixed goldenLayout to remove rowCol when removing a stack if the rowCol's parent contains only the rowCol. prevented unlocking documents from setting NativeWidth/Height
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]);
+ }
+ }
}
},