aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ImageBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r--src/client/views/nodes/ImageBox.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 4092a2575..1d79febdf 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -63,12 +63,12 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp
@action
scrollFocus = (anchor: Doc, smooth: boolean) => {
- let focusSpeed: Opt<number>;
- PresBox.restoreTargetDocView(
+ const focusSpeed = !smooth ? 0 : NumCast(anchor.presTransition);
+ return PresBox.restoreTargetDocView(
this.rootDoc, //
{ pinDocLayout: BoolCast(anchor.presPinDocLayout) },
anchor,
- (focusSpeed = !smooth ? 0 : NumCast(anchor.presTransition)),
+ focusSpeed,
!anchor.presPinData
? {}
: {
@@ -76,8 +76,9 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp
dataannos: anchor.presAnnotations !== undefined,
dataview: true,
}
- );
- return focusSpeed;
+ )
+ ? focusSpeed
+ : undefined;
}; // sets viewing information for a componentview, typically when following a link. 'preview' tells the view to use the values without writing to the document
getAnchor = () => {