diff options
| author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-30 16:03:23 -0400 |
|---|---|---|
| committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-30 16:03:23 -0400 |
| commit | 28db2fab55015f26286c577347a90e5acb24ca0f (patch) | |
| tree | bdb7e1286267ea805bbc10496a3a66ba6e3552dd /src/client/views/collections/CollectionDockingView.tsx | |
| parent | 26086ee95a9a16486d637aa43c96638b6154379f (diff) | |
| parent | cc271d2802cab295221dc4ea3d8c77a6328a8cfb (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.tsx | 20 |
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(); } |
