mirror of https://github.com/logseq/logseq
parent
9de1f01db8
commit
97239cde65
|
@ -607,12 +607,17 @@
|
|||
(editor-handler/close-autocomplete-if-outside input))))))))
|
||||
{:did-mount (fn [state]
|
||||
(let [[{:keys [dummy? format block-parent-id]} id] (:rum/args state)
|
||||
content (get-in @state/state [:editor/content id])]
|
||||
content (get-in @state/state [:editor/content id])
|
||||
input (gdom/getElement id)]
|
||||
(when block-parent-id
|
||||
(state/set-editing-block-dom-id! block-parent-id))
|
||||
(editor-handler/restore-cursor-pos! id content dummy?)
|
||||
(if (= :indent-outdent (state/get-editor-op))
|
||||
(when input
|
||||
(when-let [pos (state/get-edit-pos)]
|
||||
(util/set-caret-pos! input pos)))
|
||||
(editor-handler/restore-cursor-pos! id content dummy?))
|
||||
|
||||
(when-let [input (gdom/getElement id)]
|
||||
(when input
|
||||
(dnd/subscribe!
|
||||
input
|
||||
:upload-images
|
||||
|
|
|
@ -2433,14 +2433,15 @@
|
|||
;; block/uuid and block/content
|
||||
(defn get-all-block-contents
|
||||
[]
|
||||
(->> (d/datoms (get-conn) :avet :block/uuid)
|
||||
(map :v)
|
||||
(map (fn [id]
|
||||
(let [e (entity [:block/uuid id])]
|
||||
{:db/id (:db/id e)
|
||||
:block/uuid id
|
||||
:block/content (:block/content e)
|
||||
:block/format (:block/format e)})))))
|
||||
(when-let [conn (get-conn)]
|
||||
(->> (d/datoms conn :avet :block/uuid)
|
||||
(map :v)
|
||||
(map (fn [id]
|
||||
(let [e (entity [:block/uuid id])]
|
||||
{:db/id (:db/id e)
|
||||
:block/uuid id
|
||||
:block/content (:block/content e)
|
||||
:block/format (:block/format e)}))))))
|
||||
|
||||
(defn get-all-templates
|
||||
[]
|
||||
|
|
Loading…
Reference in New Issue