fix(pdf): area highlights don't blink

Area highlights don't blink when jumping to it.  

Maybe we could unify the id naming style of all highlights elements. So, area highlights will blink as text highlights do.

- `id` of text highlight: 27e3b9d019/src/main/frontend/extensions/pdf/core.cljs (L254)

- [The part for blinking](27e3b9d019/src/main/frontend/extensions/pdf/utils.js (L123C5-L130)) in `pdf/utils.js` 
``` js
  // blink highlight
  function blinkHighlight () {
    const id = highlight?.id
    const el = document.getElementById(`hl_${id}`)
    if (!el) return
    el.classList.add('hl-flash')
    setTimeout(() => el?.classList.remove('hl-flash'), 1200)
  }
```  
PS: I don't know if disabling the blinking is by design. Let me know if it's not a bug but a feature :)
pull/10765/head
e-zz 2023-12-21 00:24:25 +01:00 committed by Tienson Qin
parent 8040168d1e
commit 28de2b70ab
1 changed files with 1 additions and 1 deletions

View File

@ -371,7 +371,7 @@
(when-let [vw-bounding (get-in vw-hl [:position :bounding])]
(let [{:keys [color]} (:properties hl)]
[:div.extensions__pdf-hls-area-region
{:id id
{:id (str "hl_" id)
:ref *el
:style vw-bounding
:data-color color