diff options
| author | yipstanley <stanley_yip@brown.edu> | 2019-07-30 16:34:05 -0400 |
|---|---|---|
| committer | yipstanley <stanley_yip@brown.edu> | 2019-07-30 16:34:05 -0400 |
| commit | bf5761377d375d5d7a2ff99caf0af0d332562197 (patch) | |
| tree | fb9319c69a15a4e8f134b360f0858ccd60609f8c /src/client/views/collections/CollectionDockingView.tsx | |
| parent | 676534c7ad5fd5fa155f4b76856ff33a08d8ab49 (diff) | |
| parent | f3d82375cd2e7e1f658824081eda2a5c618b2198 (diff) | |
Merge branch 'master' of https://github.com/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(); } |
