refactor: switch back to store properties directly in plain-text

This commit is contained in:
Tienson Qin
2021-04-14 10:51:14 +08:00
parent 073e0cc554
commit e873690a8b
7 changed files with 74 additions and 44 deletions

View File

@@ -317,14 +317,15 @@
(.setSelectionRange input pos pos)))
#?(:cljs
(defn get-caret-pos
[input]
(try
(let [pos ((gobj/get caret-pos "position") input)]
(set! pos -rect (.. input (getBoundingClientRect) (toJSON)))
(bean/->clj pos))
(catch js/Error e
(js/console.error e)))))
(defn get-caret-pos
[input]
(when input
(try
(let [pos ((gobj/get caret-pos "position") input)]
(set! pos -rect (.. input (getBoundingClientRect) (toJSON)))
(bean/->clj pos))
(catch js/Error e
(js/console.error e))))))
(defn get-first-or-last-line-pos
[input]