diff options
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index e4fc6c4a2..e8c33a10e 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -156,7 +156,6 @@ export interface DocumentViewSharedProps { contentBounds?: () => undefined | { x: number; y: number; r: number; b: number }; fitContentsToBox?: () => boolean; // used by freeformview to fit its contents to its panel. corresponds to _freeform_fitContentsToBox property on a Document suppressSetHeight?: boolean; - thumbShown?: () => boolean; setContentView?: (view: DocComponentView) => any; CollectionFreeFormDocumentView?: () => CollectionFreeFormDocumentView; PanelWidth: () => number; @@ -299,10 +298,11 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps return this.props.styleProvider?.(this.layoutDoc, this.props, StyleProp.BorderRounding); } @computed get widgetDecorations() { - return this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.Decorations + (this.props.isSelected() ? ':selected' : '')); + TraceMobx(); + return this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.Decorations); } @computed get backgroundBoxColor() { - return this.thumbShown() ? undefined : this.props.styleProvider?.(this.layoutDoc, this.props, StyleProp.BackgroundColor + ':box'); + return this.props.styleProvider?.(this.layoutDoc, this.props, StyleProp.BackgroundColor + ':box'); } @computed get docContents() { return this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.DocContents); @@ -317,7 +317,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps return this.props?.styleProvider?.(this.layoutDoc, this.props, StyleProp.TitleHeight) || 0; } @computed get pointerEvents(): 'none' | 'all' | 'visiblePainted' | undefined { - return this.props.styleProvider?.(this.Document, this.props, StyleProp.PointerEvents + (this.props.isSelected() ? ':selected' : '')); + return this.props.styleProvider?.(this.Document, this.props, StyleProp.PointerEvents); } @computed get finalLayoutKey() { return StrCast(this.Document.layout_fieldKey, 'layout'); @@ -884,23 +884,6 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps : undefined; } isContentActive = (): boolean | undefined => this._isContentActive; - @observable _retryThumb = 1; - @computed get _thumbShown() { - const childHighlighted = () => false; - // Array.from(Doc.highlightedDocs.keys()) - // .concat(Array.from(Doc.brushManager.BrushedDoc.keys())) - // .some(doc => Doc.AreProtosEqual(DocCast(doc.annotationOn), this.rootDoc)); - const childOverlayed = () => Array.from(DocumentManager._overlayViews).some(view => Doc.AreProtosEqual(view.rootDoc, this.rootDoc)); - return !this.props.LayoutTemplateString && - !this.isContentActive() && - LightboxView.LightboxDoc !== this.rootDoc && - this.thumb && - !Doc.AreProtosEqual(DocumentLinksButton.StartLink, this.rootDoc) && - ((!childHighlighted() && !childOverlayed() && !Doc.isBrushedHighlightedDegree(this.rootDoc)) || this.rootDoc._type_collection === CollectionViewType.Docking) - ? true - : false; - } - thumbShown = () => this._thumbShown; childFilters = () => [...this.props.childFilters(), ...StrListCast(this.layoutDoc.childFilters)]; /// disable pointer events on content when there's an enabled onClick script (but not the browse script) and the contents aren't forced active, or if contents are marked inactive @@ -918,25 +901,11 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps pointerEvents: (isInk ? 'none' : this.contentPointerEvents()) ?? 'all', height: this.headerMargin ? `calc(100% - ${this.headerMargin}px)` : undefined, }}> - {!this._retryThumb || !this.thumbShown() ? null : ( - <img - style={{ background: 'white', top: 0, position: 'relative' }} - src={this.thumb} // + '?d=' + (new Date()).getTime()} - width={this.props.PanelWidth()} - height={this.props.PanelHeight()} - onError={(e: any) => { - setTimeout(action(() => (this._retryThumb = 0))); - // prettier-ignore - setTimeout(action(() => (this._retryThumb = 1)), 150 ); - }} - /> - )} <DocumentContentsView key={1} {...this.props} pointerEvents={this.contentPointerEvents} docViewPath={this.props.viewPath} - thumbShown={this.thumbShown} setContentView={this.setContentView} childFilters={this.childFilters} NativeDimScaling={this.props.NativeDimScaling} @@ -1232,10 +1201,10 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps } } @computed get highlighting() { - return this.props.styleProvider?.(this.props.Document, this.props, StyleProp.Highlighting); + return this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.Highlighting); } @computed get borderPath() { - return this.props.styleProvider?.(this.props.Document, this.props, StyleProp.BorderPath); + return this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.BorderPath); } render() { TraceMobx(); |