diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2020-04-07 11:52:25 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2020-04-07 11:52:25 -0400 |
| commit | 892174ef482f3d45167a0c2d1c3163e6b9443c66 (patch) | |
| tree | 6457eeb1db901920001ea6bf69e3bb8574fcde48 /src/client/views/nodes/DocumentView.tsx | |
| parent | 8b02394f24e4f15674bf18192f49ee2385d67655 (diff) | |
got rid of some run-time errors/warnings related to CORS-ifying imagebox requests, and avoiding memoizing messages for computedFn's outside reactions.
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
| -rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index f374b5803..2df5c9bbd 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -64,7 +64,7 @@ export interface DocumentViewProps { LayoutDoc?: () => Opt<Doc>; LibraryPath: Doc[]; fitToBox?: boolean; - rootSelected: () => boolean; // whether the root of a template has been selected + rootSelected: (outsideReaction?: boolean) => boolean; // whether the root of a template has been selected onClick?: ScriptField; onPointerDown?: ScriptField; onPointerUp?: ScriptField; @@ -964,8 +964,8 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu const fallback = Cast(this.props.Document.layoutKey, "string"); return typeof fallback === "string" ? fallback : "layout"; } - rootSelected = () => { - return this.isSelected(false) || (this.props.Document.forceActive && this.props.rootSelected?.() ? true : false); + rootSelected = (outsideReaction: boolean) => { + return this.isSelected(outsideReaction) || (this.props.Document.forceActive && this.props.rootSelected?.(outsideReaction) ? true : false); } childScaling = () => (this.layoutDoc._fitWidth ? this.props.PanelWidth() / this.nativeWidth : this.props.ContentScaling()); panelWidth = () => this.props.PanelWidth(); |
