From 1763ff090ea734ca275c3c28edc6c303c935b801 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 25 Jan 2023 12:59:50 -0500 Subject: added a linkFollow o[ption to choose between opening target, or highest level collection containing target. fixed adding marker annotations to pdf/web/etc. fixed following link to wikipedia pages to not create a new document each time. made searchBox's search function static so that it can be called programmatically. Fixed LinkDocPreview to not flicker when doing a nopreview link follow. changed PlayTrail to restore state of all freeform collections containing source anchor. --- src/client/views/nodes/trails/PresBox.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/client/views/nodes/trails') diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx index 4a60c99ec..ff05dcdcb 100644 --- a/src/client/views/nodes/trails/PresBox.tsx +++ b/src/client/views/nodes/trails/PresBox.tsx @@ -624,14 +624,18 @@ export class PresBox extends ViewBoxBaseComponent() { }; _exitTrail: Opt<() => void>; - PlayTrail = (doc: Doc) => { - const savedState = { c: doc, x: NumCast(doc.panX), y: NumCast(doc.panY), s: NumCast(doc.viewScale) }; + PlayTrail = (docs: Doc[]) => { + const savedStates = docs.map(doc => (doc._viewType !== CollectionViewType.Freeform ? undefined : { c: doc, x: NumCast(doc.panX), y: NumCast(doc.panY), s: NumCast(doc.viewScale) })); this.startPresentation(0); this._exitTrail = () => { - const { x, y, s, c } = savedState; - c._panX = x; - c._panY = y; - c._viewScale = s; + savedStates + .filter(savedState => savedState) + .map(savedState => { + const { x, y, s, c } = savedState!; + c._panX = x; + c._panY = y; + c._viewScale = s; + }); LightboxView.SetLightboxDoc(undefined); Doc.RemoveDocFromList(Doc.MyOverlayDocs, undefined, this.rootDoc); return PresStatus.Edit; -- cgit v1.2.3-70-g09d2