fix(ui): reactive block state for all the order list related items

This commit is contained in:
charlie
2023-04-18 18:24:12 +08:00
parent 339360a3dc
commit 22246fcdb3
2 changed files with 43 additions and 21 deletions

View File

@@ -309,4 +309,12 @@
(count (order-sibling-list block)) 1)
order-parents-count (count (order-parent-list block))]
(if (odd? order-parents-count)
idx (nth (seq "abcdefghijklmnopqrstuvwxyz") (mod (dec idx) 26)))))))
idx (nth (seq "abcdefghijklmnopqrstuvwxyz") (mod (dec idx) 26)))))))
(defn attach-order-list-state
[config block]
(let [own-order-list-type (some-> block :block/properties :logseq.order-list-type str string/lower-case)]
(let [own-order-list-index (some->> own-order-list-type (get-idx-of-order-list-block block))]
(assoc config :own-order-list-type own-order-list-type
:own-order-list-index own-order-list-index
:own-order-number-list? (= own-order-list-type "number")))))