aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-02-19 17:36:48 -0500
committerbob <bcz@cs.brown.edu>2019-02-19 17:36:48 -0500
commit594ac91c42d9f90ebd960a9683a69611c4ad63cb (patch)
tree63322a149798c9cd0fd86e7f789b00226433ada6 /src
parentaf42b410a1575527094e2ec96e7df72f224ef45d (diff)
not much
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 842312faa..6739416df 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -94,7 +94,7 @@ export class CollectionDockingView extends CollectionViewBase {
type: 'stack',
content: [CollectionDockingView.makeDocumentConfig(document)]
};
- var newContentItem = new this._goldenLayout._typeToItem[newItemStackConfig.type](this._goldenLayout, newItemStackConfig, parent);
+ var newContentItem = new this._goldenLayout._typeToItem[newItemStackConfig.type](this._goldenLayout, newItemStackConfig, null);
if (this._goldenLayout.root.contentItems[0].isRow) {
this._goldenLayout.root.contentItems[0].addChild(newContentItem);
@@ -110,21 +110,21 @@ export class CollectionDockingView extends CollectionViewBase {
collayout.config["width"] = 50;
newContentItem.config["width"] = 50;
}
- this._forceRecreate = true;
+ this.stateChanged(); // shouldn't need to do either of these ... but our react component doesn't render when we add it manually like this.
+ this.setupGoldenLayout(true); // this forces it to render by the brute force method of recreating the whole golden layout
}
- setupGoldenLayout() {
+ setupGoldenLayout(force: boolean = false) {
var config = this.props.Document.GetText(KeyStore.Data, "");
if (config) {
if (!this._goldenLayout)
this._goldenLayout = new GoldenLayout(JSON.parse(config));
else {
- if (!this._forceRecreate && JSON.stringify(this._goldenLayout.toConfig()) == JSON.stringify(JSON.parse(config)))
+ if (!force && JSON.stringify(this._goldenLayout.toConfig()) == JSON.stringify(JSON.parse(config)))
return;
this._goldenLayout.destroy();
this._goldenLayout = new GoldenLayout(JSON.parse(config));
}
- this._forceRecreate = false;
this._goldenLayout.on('tabCreated', this.tabCreated);
this._goldenLayout.on('stackCreated', this.stackCreated);
this._goldenLayout.registerComponent('DocumentFrameRenderer', DockedFrameRenderer);