From 84cf9d6536b0e7eb75cec22bc69a11937b7c47b1 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 10 Mar 2022 13:58:38 -0500 Subject: added prop when thumbnail is shown for a document so componentView can choose not to render. fixed pdf views to not generate gray box when first transitioning from thumb to live view. --- src/client/views/nodes/DocumentView.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/client/views/nodes/DocumentView.tsx') diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 274ccb807..7092b335c 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -109,6 +109,7 @@ export interface DocumentViewSharedProps { fitContentsToDoc?: () => boolean; // used by freeformview to fit its contents to its panel. corresponds to _fitToBox property on a Document ContainingCollectionView: Opt; ContainingCollectionDoc: Opt; + thumbShown?: () => boolean; setContentView?: (view: DocComponentView) => any; CollectionFreeFormDocumentView?: () => CollectionFreeFormDocumentView; PanelWidth: () => number; @@ -838,6 +839,9 @@ export class DocumentViewInternal extends DocComponent !this.props.isSelected() && LightboxView.LightboxDoc !== this.rootDoc && this.thumb && + !this._componentView?.isAnyChildContentActive?.() ? true : false; @computed get contents() { TraceMobx(); const audioView = !this.layoutDoc._showAudio ? (null) : @@ -851,11 +855,17 @@ export class DocumentViewInternal extends DocComponent - {!this.thumb ? (null) : + {!this._retryThumb || !this.thumbShown() ? (null) :