mirror of
https://github.com/logseq/logseq.git
synced 2026-05-01 09:26:28 +00:00
Add action whitelist and special handling for link/image input dialog
This commit is contained in:
committed by
Tienson Qin
parent
2970ff6c58
commit
7cb1fc9c3c
@@ -1729,6 +1729,13 @@
|
||||
:markdown (util/format "" label link)
|
||||
:org (util/format "[[%s]]"))))
|
||||
|
||||
(defn handle-command-input-close [id]
|
||||
(state/set-editor-show-input! nil)
|
||||
(when-let [saved-cursor (state/get-editor-last-pos)]
|
||||
(when-let [input (gdom/getElement id)]
|
||||
(.focus input)
|
||||
(cursor/move-cursor-to input saved-cursor))))
|
||||
|
||||
(defn handle-command-input [command id format m]
|
||||
;; TODO: Add error handling for when user doesn't provide a required field.
|
||||
;; (The current behavior is to just revert back to the editor.)
|
||||
@@ -1752,12 +1759,7 @@
|
||||
|
||||
nil)
|
||||
|
||||
(state/set-editor-show-input! nil)
|
||||
|
||||
(when-let [saved-cursor (state/get-editor-last-pos)]
|
||||
(when-let [input (gdom/getElement id)]
|
||||
(.focus input)
|
||||
(cursor/move-cursor-to input saved-cursor))))
|
||||
(handle-command-input-close id))
|
||||
|
||||
(defn get-search-q
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user