mirror of https://github.com/logseq/logseq
fix(ux): turn the block into ordered item when it's moved to the first item from target ordered children
parent
90f4bff1d5
commit
f55ccda97e
|
@ -79,10 +79,6 @@
|
|||
(when-let [uuid (:block/uuid block)]
|
||||
(remove-block-property! uuid :logseq.order-list-type)))
|
||||
|
||||
(defn own-order-list?
|
||||
[block]
|
||||
(not (string/blank? (get-block-own-order-list-type block))))
|
||||
|
||||
(defn own-order-number-list?
|
||||
[block]
|
||||
(= (get-block-own-order-list-type block) "number"))
|
||||
|
|
|
@ -411,15 +411,16 @@
|
|||
|
||||
(defn blocks-with-?ordered-list-props
|
||||
[blocks target-block sibling?]
|
||||
(letfn [(list-type-fn [b] (some-> b :block/properties :logseq.order-list-type))]
|
||||
(if-let [list-type (and sibling? target-block (list-type-fn target-block))]
|
||||
(mapv
|
||||
(fn [block]
|
||||
(cond-> block
|
||||
(some? (:block/properties block))
|
||||
(assoc-in [:block/properties :logseq.order-list-type] list-type)))
|
||||
blocks)
|
||||
blocks)))
|
||||
(let [target-block (if sibling? target-block (some-> target-block :db/id db/pull block tree/-get-down :data))]
|
||||
(letfn [(list-type-fn [b] (some-> b :block/properties :logseq.order-list-type))]
|
||||
(if-let [list-type (and target-block (list-type-fn target-block))]
|
||||
(mapv
|
||||
(fn [block]
|
||||
(cond-> block
|
||||
(some? (:block/uuid block))
|
||||
(update :block/properties #(assoc % :logseq.order-list-type list-type))))
|
||||
blocks)
|
||||
blocks))))
|
||||
|
||||
;;; ### insert-blocks, delete-blocks, move-blocks
|
||||
|
||||
|
|
Loading…
Reference in New Issue