mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: allow moving non page blocks to library on UI
This commit is contained in:
8
deps/outliner/src/logseq/outliner/core.cljs
vendored
8
deps/outliner/src/logseq/outliner/core.cljs
vendored
@@ -240,7 +240,7 @@
|
||||
(defn- remove-inline-page-classes
|
||||
[db {:block/keys [tags] :as block}]
|
||||
;; Notice: should check `page?` for block from the current db
|
||||
(if (ldb/page? (d/entity db (:db/id block)))
|
||||
(if (or (ldb/page? (d/entity db (:db/id block))) (:block/name block))
|
||||
block
|
||||
(let [tags' (cond
|
||||
(or (integer? tags)
|
||||
@@ -922,10 +922,8 @@
|
||||
(let [target-block (d/entity db (:db/id target-block))
|
||||
block (d/entity db (:db/id block))]
|
||||
(if (or
|
||||
;; target-block doesn't have parent or moving non-page block to library
|
||||
(and sibling? (or (nil? (:block/parent target-block))
|
||||
(and (not (ldb/page? block))
|
||||
(ldb/library? (:block/parent target-block)))))
|
||||
;; target-block doesn't have parent
|
||||
(and sibling? (nil? (:block/parent target-block)))
|
||||
;; move page to be a child of block
|
||||
(and (not sibling?)
|
||||
(not (ldb/page? target-block))
|
||||
|
||||
@@ -183,14 +183,7 @@
|
||||
page-tag-update? (and (= :block/tags (:a datom))
|
||||
(= (:db/id page-tag) (:v datom)))
|
||||
move-to-library? (and (= :block/parent (:a datom))
|
||||
(or (= (:db/id library-page) (:v datom))
|
||||
(and
|
||||
(ldb/page? (d/entity db (:v datom)))
|
||||
(let [parents (->> (ldb/get-block-parents db (:block/uuid (d/entity db (:v datom))))
|
||||
(map :db/id)
|
||||
(set))]
|
||||
(contains? parents (:db/id library-page)))))
|
||||
|
||||
(= (:db/id library-page) (:v datom))
|
||||
(:added datom))]
|
||||
(when (or page-tag-update? move-to-library?)
|
||||
(let [block-before (d/entity db-before id)
|
||||
|
||||
Reference in New Issue
Block a user