浏览代码

refactor: refactor breadcrumb-show? logic

defclass 5 年之前
父节点
当前提交
24f86232c5
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 3 3
      src/main/frontend/components/block.cljs
  2. 1 1
      src/main/frontend/components/reference.cljs

+ 3 - 3
src/main/frontend/components/block.cljs

@@ -1176,7 +1176,7 @@
                   state))}
   [config {:block/keys [uuid title level body meta content dummy? page format repo children collapsed? pre-block? idx properties] :as block}]
   (let [ref? (boolean (:ref? config))
-        ref-child? (:ref-child? config)
+        breadcrumb-show? (:breadcrumb-show? config)
         sidebar? (boolean (:sidebar? config))
         slide? (boolean (:slide? config))
         doc-mode? (:document/mode? config)
@@ -1271,7 +1271,7 @@
        (not slide?)
        (merge attrs))
 
-     (when (and ref? (not ref-child?))
+     (when (and ref? breadcrumb-show?)
        (when-let [comp (block-parents repo uuid format false)]
          [:div.my-2.opacity-50.ml-4 comp]))
 
@@ -1298,7 +1298,7 @@
          (when (seq children)
            [:div.ref-children.ml-12
             (blocks-container children (assoc config
-                                              :ref-child? true
+                                              :breadcrumb-show? false
                                               :ref? true))])))
 
      (dnd-separator-wrapper block slide? false)]))

+ 1 - 1
src/main/frontend/components/reference.cljs

@@ -61,7 +61,7 @@
                                              {:id encoded-page-name
                                               :start-level 2
                                               :ref? true
-                                              :ref-child? false
+                                              :breadcrumb-show? true
                                               :group-by-page? true
                                               :editor-box editor/box}
                                              {})]