Skip to content

Commit

Permalink
refactor: refactor breadcrumb-show? logic
Browse files Browse the repository at this point in the history
  • Loading branch information
defclass authored and tiensonqin committed Nov 4, 2020
1 parent 606b545 commit 24f8623
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/frontend/components/block.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]))

Expand All @@ -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)]))
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/components/reference.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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}
{})]
Expand Down

0 comments on commit 24f8623

Please sign in to comment.