Add option to handle default block refs expanding behaviour (#8839)

* Add option to handle default block refs expanding behaviour

* provide default value

* polish config desc for dicts

* polish config desc in template config

* specify option on settings page

* fix: typo on fn name

* chore: remove the tail period

---------

Co-authored-by: situ2001 <yongcong2001@outlook.com>
This commit is contained in:
aiirobyte
2023-03-17 21:40:38 +08:00
committed by GitHub
parent 54bd86aca7
commit 0eb25b3934
7 changed files with 40 additions and 1 deletions

View File

@@ -2383,7 +2383,7 @@
current-block-page? (= (str (:block/uuid block)) (state/get-current-page))
embed-self? (and (:embed? config)
(= (:block/uuid block) (:block/uuid (:block config))))
default-hide? (if (and current-block-page? (not embed-self?)) false true)]
default-hide? (if (and current-block-page? (not embed-self?) (state/auto-expand-block-refs?)) false true)]
(assoc state ::hide-block-refs? (atom default-hide?))))}
[state config {:block/keys [uuid format] :as block} edit-input-id block-id edit? hide-block-refs-count?]
(let [*hide-block-refs? (get state ::hide-block-refs?)