فهرست منبع

Fix vertical line collapse behaviour (#12248)

A. S. 4 روز پیش
والد
کامیت
33e34ab1be
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      src/main/frontend/handler/editor.cljs

+ 4 - 3
src/main/frontend/handler/editor.cljs

@@ -3853,10 +3853,11 @@
 
 (defn toggle-open-block-children! [block-id]
   (p/let [blocks (<all-blocks-with-level {:incremental? false
-                                          :collapse? true
+                                          :expanded? true
                                           :root-block block-id})
-          all-expanded? (empty? blocks)]
-    (if all-expanded?
+          children-blocks (remove #(= block-id (:block/uuid %)) blocks)
+          any-expanded? (seq (filter (complement util/collapsed?) children-blocks))]
+    (if any-expanded?
       (collapse-all! block-id {:collapse-self? false})
       (expand-all! block-id))))