aboutsummaryrefslogtreecommitdiff
path: root/src/client/goldenLayout.js
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2022-09-22 13:10:58 -0400
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2022-09-22 13:10:58 -0400
commit1ec9505775315d0ba41b114942ff69d8ceb93e04 (patch)
tree3dde9bb324814b419b4b5a27d9be3c30dd81d993 /src/client/goldenLayout.js
parent604b3e566eaf762ede05f4a31c459c20d0df020b (diff)
parent40cc7455e853d306ee2750c51308d095dc2970ef (diff)
Merge branch 'master' of https://github.com/brown-dash/Dash-Web
Diffstat (limited to 'src/client/goldenLayout.js')
-rw-r--r--src/client/goldenLayout.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/client/goldenLayout.js b/src/client/goldenLayout.js
index e5cd50de2..dd11e6466 100644
--- a/src/client/goldenLayout.js
+++ b/src/client/goldenLayout.js
@@ -3263,11 +3263,6 @@
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) {
- saveScrollTops(rowOrCol.contentItems[0].element);
- parRowOrCol.replaceChild(rowOrCol, rowOrCol.contentItems[0]);
- restoreScrollTops(rowOrCol.contentItems[0].element);
- }
}
}
},
@@ -4061,6 +4056,14 @@
lm.items.AbstractContentItem.prototype.removeChild.call(this, contentItem, keepChild);
if (this.contentItems.length === 1 && this.config.isClosable === true) {
+ if (["row","column"].includes(this.contentItems[0].type) || ["row","column"].includes(this.parent.type)) {
+ let parent = this.parent;
+ let correctRowOrCol = this.contentItems[0];
+ saveScrollTops(correctRowOrCol.element);
+ parent.replaceChild(this, correctRowOrCol);
+ restoreScrollTops(correctRowOrCol.element);
+ }
+
// bcz: this has the effect of removing children from the DOM and then re-adding them above where they were before.
// in the case of things like an iFrame with a YouTube video, the video will reload for now reason. So let's try leaving these "empty" rows alone.
// childItem = this.contentItems[0];