diff options
author | bobzel <zzzman@gmail.com> | 2021-01-11 11:33:46 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-01-11 11:33:46 -0500 |
commit | 6c1857193aa51ccfec081aaa4372de164e152355 (patch) | |
tree | 8ae584d0c0a262df63153fec097f32ab9ef80441 /src/client/goldenLayout.js | |
parent | 768ab508529ab2b7f43a44592e5dc2c9f15a68a5 (diff) | |
parent | e80e0e3938f1f7c5f740553eb5cb7b152f2598e8 (diff) |
Merge branch 'master' into ink_edits
Diffstat (limited to 'src/client/goldenLayout.js')
-rw-r--r-- | src/client/goldenLayout.js | 11 |
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]); + } + } } }, |