From ea55659c15031fc4edc717b7c900f8d3f029f2f8 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 15 May 2024 10:02:52 -0400 Subject: Make pres aniamtions last as long as their transition time --- src/fields/Doc.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/fields') 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(); -- cgit v1.2.3-70-g09d2