aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ImageBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-11-17 11:00:06 -0500
committerbobzel <zzzman@gmail.com>2022-11-17 11:00:06 -0500
commit30e7fc1b2cb4b5c5f8d5f5e4f808b91e69629245 (patch)
treeeebb234b17b611bc89cd4813cf14556466f18736 /src/client/views/nodes/ImageBox.tsx
parent54dc7b2c44194d98111100bc1350b7ac6c5901bc (diff)
fixed pushpin behaviors by not animating when anchor viewspec already matched document. fixed recording button highlighting. switched LinkEditor to edit properties of destination insteqad of source anchor
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 = () => {