mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 18:06:32 +00:00
enhance(query table): click to edit and human-readable time
This commit is contained in:
@@ -819,24 +819,25 @@
|
||||
(let [block (db/entity [:block/uuid block-id])]
|
||||
(seq (:block/_parent block)))))]
|
||||
(when-not (and has-children? left-has-children?)
|
||||
(let [block-parent (gdom/getElement block-parent-id)
|
||||
sibling-block (util/get-prev-block-non-collapsed block-parent)]
|
||||
(delete-block-aux! block delete-children?)
|
||||
(when (and repo sibling-block)
|
||||
(when-let [sibling-block-id (dom/attr sibling-block "blockid")]
|
||||
(when-let [block (db/pull repo '[*] [:block/uuid (uuid sibling-block-id)])]
|
||||
(let [original-content (util/trim-safe (:block/content block))
|
||||
new-value (str original-content " " (string/triml value))
|
||||
tail-len (count (string/triml value))
|
||||
pos (max
|
||||
(if original-content
|
||||
(utf8/length (utf8/encode original-content))
|
||||
0)
|
||||
0)]
|
||||
(edit-block! block pos format id
|
||||
{:custom-content new-value
|
||||
:tail-len tail-len
|
||||
:move-cursor? false}))))))))))))
|
||||
(when block-parent-id
|
||||
(let [block-parent (gdom/getElement block-parent-id)
|
||||
sibling-block (util/get-prev-block-non-collapsed block-parent)]
|
||||
(delete-block-aux! block delete-children?)
|
||||
(when (and repo sibling-block)
|
||||
(when-let [sibling-block-id (dom/attr sibling-block "blockid")]
|
||||
(when-let [block (db/pull repo '[*] [:block/uuid (uuid sibling-block-id)])]
|
||||
(let [original-content (util/trim-safe (:block/content block))
|
||||
new-value (str original-content " " (string/triml value))
|
||||
tail-len (count (string/triml value))
|
||||
pos (max
|
||||
(if original-content
|
||||
(utf8/length (utf8/encode original-content))
|
||||
0)
|
||||
0)]
|
||||
(edit-block! block pos format id
|
||||
{:custom-content new-value
|
||||
:tail-len tail-len
|
||||
:move-cursor? false})))))))))))))
|
||||
(state/set-editor-op! nil)))
|
||||
|
||||
(defn- get-end-block-parent
|
||||
|
||||
Reference in New Issue
Block a user