Răsfoiți Sursa

fix: move a child to its parent of parent

Tienson Qin 2 ani în urmă
părinte
comite
bc422b1718
1 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 4 4
      src/main/frontend/modules/outliner/core.cljs

+ 4 - 4
src/main/frontend/modules/outliner/core.cljs

@@ -707,7 +707,11 @@
                      [block sibling?]
                      (let [target (or linked block)]
                        (if (and up?
+                                ;; target is not any parent of the first block
                                 (not= (:db/id (:block/parent (first blocks)))
+                                      (:db/id target))
+                                (not= (:db/id (:block/parent
+                                               (db/entity (:db/id (:block/parent (first blocks))))))
                                       (:db/id target)))
                          (get-last-child-or-self target)
                          [target false])))
@@ -723,10 +727,6 @@
 
                    :else
                    [block sibling?])]
-      ;; (prn :debug {:result result
-      ;;              :sibling? sibling?
-      ;;              :block {:db/id (:db/id block)
-      ;;                      :block/content (:block/content block)}})
       result)))
 
 (defn insert-blocks