diff options
| author | bobzel <zzzman@gmail.com> | 2024-05-15 10:02:52 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-05-15 10:02:52 -0400 |
| commit | ea55659c15031fc4edc717b7c900f8d3f029f2f8 (patch) | |
| tree | 3f88c2c99fa637fcb61b662e81381709defea343 /src/fields | |
| parent | 19990a3edb29cb1a8ce09659db1a51cd36cbb4ad (diff) | |
Make pres aniamtions last as long as their transition time
Diffstat (limited to 'src/fields')
| -rw-r--r-- | src/fields/Doc.ts | 4 |
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>(); |
