aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-07-30 11:01:07 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-07-30 11:01:07 -0400
commite806e56d950c9e76ca44f3aab25753af4179d11c (patch)
tree26e08d32a85a3b82228c72f3d037e2fc764484c9 /src/client/views/collections
parente0851a9bcde60b71dbf64a256c611288a1da8025 (diff)
parentca91fe9e379fe3e2d48a0eb055415f008245ed31 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into speech-to-text
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index ab4d1aa62..588102f01 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -210,20 +210,22 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
docs.push(document);
}
let docContentConfig = CollectionDockingView.makeDocumentConfig(document, dataDocument);
- var newContentItem = stack.layoutManager.createContentItem(docContentConfig, this._goldenLayout);
if (stack === undefined) {
- if (this._goldenLayout.root.contentItems.length === 0) {
- this._goldenLayout.root.addChild(newContentItem);
- } else {
- const rowOrCol = this._goldenLayout.root.contentItems[0];
- if (rowOrCol.contentItems.length) {
- rowOrCol.contentItems[0].addChild(newContentItem);
+ let stack: any = this._goldenLayout.root;
+ while (!stack.isStack) {
+ if (stack.contentItems.length) {
+ stack = stack.contentItems[0];
} else {
- rowOrCol.addChild(newContentItem);
+ stack.addChild({ type: 'stack', content: [docContentConfig] });
+ stack = undefined;
+ break;
}
}
+ if (stack) {
+ stack.addChild(docContentConfig);
+ }
} else {
- stack.addChild(newContentItem.contentItems[0], undefined);
+ stack.addChild(docContentConfig, undefined);
}
this.layoutChanged();
}