aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionDockingView.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-07-30 16:03:23 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-07-30 16:03:23 -0400
commit28db2fab55015f26286c577347a90e5acb24ca0f (patch)
treebdb7e1286267ea805bbc10496a3a66ba6e3552dd /src/client/views/collections/CollectionDockingView.tsx
parent26086ee95a9a16486d637aa43c96638b6154379f (diff)
parentcc271d2802cab295221dc4ea3d8c77a6328a8cfb (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/collections/CollectionDockingView.tsx')
-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();
}