mirror of
https://github.com/logseq/logseq.git
synced 2026-05-25 05:04:24 +00:00
fix: clicking block bullets in portal
This commit is contained in:
@@ -536,10 +536,10 @@
|
||||
(:db/id page-entity)
|
||||
:page))
|
||||
|
||||
(whiteboard-handler/inside-whiteboard-portal-container (.-target e))
|
||||
(whiteboard-handler/inside-portal (.-target e))
|
||||
(whiteboard-handler/add-new-block-portal-shape!
|
||||
page-name
|
||||
(whiteboard-handler/closest-whiteboard-shape-id (.-target e)))
|
||||
(whiteboard-handler/closest-shape (.-target e)))
|
||||
|
||||
whiteboard-page?
|
||||
(route-handler/redirect-to-whiteboard! page-name)
|
||||
@@ -898,10 +898,10 @@
|
||||
(:db/id block)
|
||||
:block-ref)
|
||||
|
||||
(whiteboard-handler/inside-whiteboard-portal-container (.-target e))
|
||||
(whiteboard-handler/inside-portal (.-target e))
|
||||
(whiteboard-handler/add-new-block-portal-shape!
|
||||
(:block/uuid block)
|
||||
(whiteboard-handler/closest-whiteboard-shape-id (.-target e)))
|
||||
(whiteboard-handler/closest-shape (.-target e)))
|
||||
|
||||
:else
|
||||
(match [block-type (util/electron?)]
|
||||
@@ -1647,13 +1647,22 @@
|
||||
|
||||
(defn- bullet-on-click
|
||||
[e block uuid]
|
||||
(if (gobj/get e "shiftKey")
|
||||
(cond
|
||||
(gobj/get e "shiftKey")
|
||||
(do
|
||||
(state/sidebar-add-block!
|
||||
(state/get-current-repo)
|
||||
(:db/id block)
|
||||
:block)
|
||||
(util/stop e))
|
||||
|
||||
(whiteboard-handler/inside-portal (.-target e))
|
||||
(do (whiteboard-handler/add-new-block-portal-shape!
|
||||
uuid
|
||||
(whiteboard-handler/closest-shape (.-target e)))
|
||||
(util/stop e))
|
||||
|
||||
:else
|
||||
(route-handler/redirect-to-page! uuid)))
|
||||
|
||||
(rum/defc block-children < rum/reactive
|
||||
|
||||
@@ -197,11 +197,11 @@
|
||||
(db-utils/transact! [tx])
|
||||
uuid))
|
||||
|
||||
(defn inside-whiteboard-portal-container
|
||||
(defn inside-portal
|
||||
[target]
|
||||
(dom/closest target ".tl-logseq-cp-container"))
|
||||
|
||||
(defn closest-whiteboard-shape-id
|
||||
(defn closest-shape
|
||||
[target]
|
||||
(when-let [shape-el (dom/closest target "[data-shape-id]")]
|
||||
(.getAttribute shape-el "data-shape-id")))
|
||||
Reference in New Issue
Block a user