mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 02:46:45 +00:00
feat(ui): WIP number list block (own-property)
This commit is contained in:
@@ -291,3 +291,16 @@
|
||||
(recur parent (conj result parent))
|
||||
result))))]
|
||||
(distinct (mapcat get-parents filtered-ref-blocks)))))
|
||||
|
||||
(defn get-idx-of-order-list-block
|
||||
[block order-list-type]
|
||||
(let [order-block-fn? #(some-> % :block/properties :logseq.order-list-type (= order-list-type))
|
||||
prev-block-fn #(some->> (:db/id %) (db-model/get-prev-sibling (state/get-current-repo)))
|
||||
prev-block (prev-block-fn block)]
|
||||
(if prev-block
|
||||
(letfn [(sibling-list [b]
|
||||
(lazy-seq
|
||||
(when (order-block-fn? b)
|
||||
(cons b (sibling-list (prev-block-fn b))))))]
|
||||
(count (sibling-list block)))
|
||||
1)))
|
||||
Reference in New Issue
Block a user