mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 01:46:35 +00:00
enhance: enhance PDF reading experience. (#12121)
* enhance: enhance PDF reading experience. - [X] Save zoom in/out scale for next opening - [X] prevent zoom level reset when window/frame changed. fix for #4402 - [X] add a reset zoom button on the pdf toolbar, it gives an opportunity to user manually reset zoom scale to 'auto', it mimics Zotero PDF reader behavior. - [X] Support zoom in/out with Meta/CTL + mouse wheel and track pad pinch * enhance(pdf): allow number or string for last visit scale in debounce function * enhance(pdf): improve scale conditions for the wheel event --------- Co-authored-by: charlie <xyhp915@qq.com>
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
(:require ["/frontend/extensions/pdf/utils" :as js-utils]
|
||||
[cljs-bean.core :as bean]
|
||||
[clojure.string :as string]
|
||||
[frontend.util :as util]
|
||||
[logseq.common.uuid :as common-uuid]
|
||||
[promesa.core :as p]))
|
||||
|
||||
@@ -109,10 +108,13 @@
|
||||
([^js win]
|
||||
(some-> win (.getSelection) (.removeAllRanges))))
|
||||
|
||||
(def adjust-viewer-size!
|
||||
(util/debounce
|
||||
(fn [^js viewer] (set! (. viewer -currentScaleValue) "auto"))
|
||||
200))
|
||||
(defn adjust-viewer-size!
|
||||
[^js viewer]
|
||||
(let [bus (.-eventBus viewer)]
|
||||
(.dispatch bus "resizing")))
|
||||
|
||||
(defn reset-viewer-auto! [^js viewer]
|
||||
(set! (. viewer -currentScaleValue) "auto"))
|
||||
|
||||
(defn fix-nested-js
|
||||
[its]
|
||||
|
||||
Reference in New Issue
Block a user