aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-03-19 16:18:48 -0400
committerbob <bcz@cs.brown.edu>2019-03-19 16:18:48 -0400
commit9eff1894078c0cbf5592646acb5e20e5761fc167 (patch)
treed535cc5a3579a77bbafb66c6476f9ef65d18cc91
parent5e416c352ebfb875482f890c6362fee5f84af1f6 (diff)
change ignore
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 5e2f67ca5..0f0276929 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -114,9 +114,7 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
setupGoldenLayout() {
var config = this.props.Document.GetText(KeyStore.Data, "");
- var ignore = this._ignoreStateChange;
- this._ignoreStateChange = "";
- if (config && ignore != config) {
+ if (config) {
if (!this._goldenLayout) {
this._goldenLayout = new GoldenLayout(JSON.parse(config));
}
@@ -150,7 +148,12 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
if (this._containerRef.current) {
reaction(
() => this.props.Document.GetText(KeyStore.Data, ""),
- () => setTimeout(() => this.setupGoldenLayout(), 1), { fireImmediately: true });
+ () => {
+ if (!this._goldenLayout || this._ignoreStateChange != JSON.stringify(this._goldenLayout.toConfig())) {
+ setTimeout(() => this.setupGoldenLayout(), 1);
+ }
+ this._ignoreStateChange = "";
+ }, { fireImmediately: true });
window.addEventListener('resize', this.onResize); // bcz: would rather add this event to the parent node, but resize events only come from Window
}