diff options
| author | bobzel <zzzman@gmail.com> | 2019-07-30 09:38:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-30 09:38:42 -0400 |
| commit | ca91fe9e379fe3e2d48a0eb055415f008245ed31 (patch) | |
| tree | 6eff8c9cfc2e7735459fbb2912b61f48a69a071b /src/client/views/collections | |
| parent | e041988b84553797699a5a232e26e72252460e01 (diff) | |
| parent | 4f0ea3428e1e98d42b356c00f276fe74a6c4a672 (diff) | |
Merge pull request #230 from browngraphicslab/presentation-preview-mohammad
Presentation preview mohammad
Diffstat (limited to 'src/client/views/collections')
| -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(); } |
