aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/DocumentManager.ts5
-rw-r--r--src/client/util/SelectionManager.ts7
2 files changed, 5 insertions, 7 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 01230bc06..3c59a8060 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -327,14 +327,15 @@ export class DocumentManager {
if (options.zoomTextSelections && Doc.UnhighlightTimer && contextView && viewSpec.text_html) {
// if the docView is a text anchor, the contextView is the PDF/Web/Text doc
- contextView.htmlOverlayEffect = StrCast(options?.effect?.presentation_effect, StrCast(options?.effect?.followLinkAnimEffect));
+ contextView.htmlOverlayEffect = options.effect;
+ contextView.textHtmlOverlayTime = options.zoomTime;
contextView.textHtmlOverlay = StrCast(targetDoc.text_html);
DocumentManager._overlayViews.add(contextView);
}
Doc.AddUnHighlightWatcher(() => {
docView.rootDoc[Animation] = undefined;
DocumentManager.removeOverlayViews();
- contextView && (contextView.htmlOverlayEffect = '');
+ contextView && (contextView.htmlOverlayEffect = undefined);
});
}
}
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts
index e864458d8..f7e6fa2dc 100644
--- a/src/client/util/SelectionManager.ts
+++ b/src/client/util/SelectionManager.ts
@@ -64,11 +64,8 @@ export namespace SelectionManager {
manager.SelectSchemaViewDoc(document);
}
- // computed functions, such as used in IsSelected generate errors if they're called outside of a
- // reaction context. Specifying the context with 'outsideReaction' allows an efficiency feature
- // to avoid unnecessary mobx invalidations when running inside a reaction.
- export function IsSelected(dv?: DocumentView | Doc): boolean {
- return (dv instanceof Doc ? Array.from(dv[DocViews]) : dv ? [dv] : []).some(dv => dv?.SELECTED);
+ export function IsSelected(doc?: Doc): boolean {
+ return Array.from(doc?.[DocViews] ?? []).some(dv => dv?.SELECTED);
}
export function DeselectAll(except?: Doc): void {