mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
enhance: preserve block collapsed state when publishing
This commit is contained in:
9
deps/publish/src/logseq/publish/render.cljs
vendored
9
deps/publish/src/logseq/publish/render.cljs
vendored
@@ -978,6 +978,7 @@
|
||||
visited
|
||||
(inc depth))
|
||||
has-children? (boolean nested)
|
||||
collapsed? (:block/collapsed? display-block)
|
||||
raw-props (entity-properties display-block ctx (:entities ctx))
|
||||
icon-prop (get raw-props :logseq.property/icon)
|
||||
tags-prop (get raw-props :block/tags)
|
||||
@@ -996,8 +997,9 @@
|
||||
properties (render-properties properties ctx (:entities ctx))
|
||||
block-uuid (:block/uuid display-block)
|
||||
block-uuid-str (some-> block-uuid str)]
|
||||
[:li.block
|
||||
(cond-> {:data-block-uuid block-uuid-str}
|
||||
[:li
|
||||
(cond-> {:data-block-uuid block-uuid-str
|
||||
:class (if collapsed? "block is-collapsed" "block")}
|
||||
block-uuid-str (assoc :id (str "block-" block-uuid-str)))
|
||||
[:div.block-content
|
||||
(when positioned-left positioned-left)
|
||||
@@ -1005,7 +1007,8 @@
|
||||
(when positioned-right positioned-right)
|
||||
(when has-children?
|
||||
[:button.block-toggle
|
||||
{:type "button" :aria-expanded "true"}
|
||||
{:type "button"
|
||||
:aria-expanded (str (not collapsed?))}
|
||||
"▾"])]
|
||||
(when positioned-below positioned-below)
|
||||
(when properties
|
||||
|
||||
Reference in New Issue
Block a user