fix: should remove the :collapse property when the block is opened in the sidebar

pull/3593/head
shidenggui 2021-12-24 22:47:59 +08:00 committed by Tienson Qin
parent 647f84edc3
commit 494532e95b
1 changed files with 14 additions and 11 deletions

View File

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