From aa4f7b37483c516b92181d3374d3151972b98383 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 24 Apr 2024 14:56:48 -0400 Subject: fixed search on pdfs to display results when pDF is not selected. fixed presentation transitions to animate. changed so that annotaitons on pdfs would highlight when following a pres slide. fixed scrolling to annotations (and other viewSpecs) from presentations by using the slide target, not the slide as the focus document. cleaned up search and fixed to unhighlight searches on close. fixe pdf search unhighligting to work. --- src/client/util/DocumentManager.ts | 4 ++-- src/client/util/SerializationHelper.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/util') diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index cca92816f..ac3721436 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -310,8 +310,8 @@ export class DocumentManager { focused = focused || nextFocus !== undefined; // keep track of whether focusing on a view needed to actually change anything // eslint-disable-next-line no-await-in-loop const { childDocView, viewSpec } = await iterator(docView); - if (!childDocView) return { viewSpec: options.anchorDoc ?? viewSpec ?? docView.Document, docView, contextView, focused }; - contextView = options.anchorDoc?.layout_unrendered && !childDocView.Document.layout_unrendered ? childDocView : docView; + if (!childDocView) return { viewSpec: viewSpec ?? docView.Document, docView, contextView, focused }; + contextView = !childDocView.Document.layout_unrendered ? childDocView : docView; docView = childDocView; } return undefined; diff --git a/src/client/util/SerializationHelper.ts b/src/client/util/SerializationHelper.ts index fa1a911f7..d9d22437c 100644 --- a/src/client/util/SerializationHelper.ts +++ b/src/client/util/SerializationHelper.ts @@ -65,7 +65,7 @@ export namespace SerializationHelper { } } -export function Deserializable(className: string, afterDeserialize?: (obj: any) => void | Promise, constructorArgs?: [string]): (constructor: { new (...args: any[]): any }) => void { +export function Deserializable(classNameForSerializer: string, afterDeserialize?: (obj: any) => void | Promise, constructorArgs?: [string]): (constructor: { new (...args: any[]): any }) => void { function addToMap(className: string, Ctor: { new (...args: any[]): any }) { const schema = getDefaultModelSchema(Ctor) as any; if (schema.targetClass !== Ctor || constructorArgs) { @@ -78,7 +78,7 @@ export function Deserializable(className: string, afterDeserialize?: (obj: any) throw new Error(`Name ${className} has already been registered as deserializable`); } } - return (ctor: { new (...args: any[]): any }) => addToMap(className, ctor); + return (ctor: { new (...args: any[]): any }) => addToMap(classNameForSerializer, ctor); } export function autoObject(): PropSchema { -- cgit v1.2.3-70-g09d2