improve(pdf): scroll to hightlight

This commit is contained in:
charlie
2021-07-19 14:30:03 +08:00
parent 906ab01d47
commit 1653b7c3db
4 changed files with 31 additions and 2 deletions

View File

@@ -49,6 +49,11 @@
layer)
layer))))
(defn scroll-to-highlight
[^js viewer hl]
(when-let [js-hl (bean/->js hl)]
(js-utils/scrollToHighlight viewer js-hl)))
(defn clear-all-selection
[]
(.removeAllRanges (js/window.getSelection)))