fix: fix sometimes the top block doesn't expand when clicking the bullet of the block

This commit is contained in:
shidenggui
2021-12-25 09:39:13 +08:00
committed by Tienson Qin
parent 494532e95b
commit 5d5811fb38
2 changed files with 29 additions and 15 deletions

View File

@@ -1336,20 +1336,15 @@
(defn- bullet-on-click
[e block uuid]
(let [block (if (-> block :block/properties :collapsed)
(do (editor-handler/expand-block! uuid)
(update-in block [:block/properties] dissoc :collapsed))
block)]
(if (gobj/get e "shiftKey")
(do
(state/sidebar-add-block!
(state/get-current-repo)
(:db/id block)
:block
block)
(util/stop e))
(route-handler/redirect-to-page! uuid))
))
(if (gobj/get e "shiftKey")
(do
(state/sidebar-add-block!
(state/get-current-repo)
(:db/id block)
:block
block)
(util/stop e))
(route-handler/redirect-to-page! uuid)))
(defn- block-left-border-on-click
[e children]