aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-15 10:02:52 -0400
committerbobzel <zzzman@gmail.com>2024-05-15 10:02:52 -0400
commitea55659c15031fc4edc717b7c900f8d3f029f2f8 (patch)
tree3f88c2c99fa637fcb61b662e81381709defea343 /src/fields
parent19990a3edb29cb1a8ce09659db1a51cd36cbb4ad (diff)
Make pres aniamtions last as long as their transition time
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/Doc.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 48214cf25..16aeb9abe 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -1276,10 +1276,12 @@ export namespace Doc {
document.removeEventListener('pointerdown', linkFollowUnhighlight);
document.addEventListener('pointerdown', linkFollowUnhighlight);
if (UnhighlightTimer) clearTimeout(UnhighlightTimer);
+ const presTransition = Number(presentation_effect?.presentation_transition);
+ const duration = isNaN(presTransition) ? 5000 : presTransition;
UnhighlightTimer = window.setTimeout(() => {
linkFollowUnhighlight();
UnhighlightTimer = 0;
- }, 5000);
+ }, duration);
}
export var highlightedDocs = new ObservableSet<Doc>();