aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionDockingView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-12-10 13:36:12 -0500
committerbobzel <zzzman@gmail.com>2021-12-10 13:36:12 -0500
commite54c1ef16b4ce0a324fac3747defdc6501834de5 (patch)
treee956e5bbe07e53a36e5ead3d637e6f7c2b01671b /src/client/views/collections/CollectionDockingView.tsx
parent8176b94970b86bd3c1669130f6fef2ccd70d0b84 (diff)
parentf8ce34c8ed42646691d1e392effe79bc27daf810 (diff)
Merge branch 'master' into ink_v1
Diffstat (limited to 'src/client/views/collections/CollectionDockingView.tsx')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 5325d5827..f543d924d 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -44,6 +44,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
}
private _reactionDisposer?: IReactionDisposer;
+ private _lightboxReactionDisposer?: IReactionDisposer;
private _containerRef = React.createRef<HTMLDivElement>();
private _flush: UndoManager.Batch | undefined;
private _ignoreStateChange = "";
@@ -298,6 +299,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
componentDidMount: () => void = () => {
if (this._containerRef.current) {
+ this._lightboxReactionDisposer = reaction(() => LightboxView.LightboxDoc, doc => setTimeout(() => !doc && this.onResize(undefined)));
new _global.ResizeObserver(this.onResize).observe(this._containerRef.current);
this._reactionDisposer = reaction(() => StrCast(this.props.Document.dockingConfig),
config => {
@@ -320,13 +322,14 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
window.removeEventListener('resize', this.onResize);
this._reactionDisposer?.();
+ this._lightboxReactionDisposer?.();
}
@action
onResize = (event: any) => {
const cur = this._containerRef.current;
// bcz: since GoldenLayout isn't a React component itself, we need to notify it to resize when its document container's size has changed
- cur && this._goldenLayout?.updateSize(cur.getBoundingClientRect().width, cur.getBoundingClientRect().height);
+ !LightboxView.LightboxDoc && cur && this._goldenLayout?.updateSize(cur.getBoundingClientRect().width, cur.getBoundingClientRect().height);
}
@action