From 7b410d46ec20c388c1944c0bac109dcb1421d0bf Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 24 May 2023 12:48:30 +0200 Subject: [PATCH] :sparkles: Editing on double click --- frontend/src/app/main/ui/workspace/viewport.cljs | 5 +++-- frontend/src/app/main/ui/workspace/viewport/actions.cljs | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/viewport.cljs b/frontend/src/app/main/ui/workspace/viewport.cljs index a45923394..a9b04c51d 100644 --- a/frontend/src/app/main/ui/workspace/viewport.cljs +++ b/frontend/src/app/main/ui/workspace/viewport.cljs @@ -168,7 +168,7 @@ on-click (actions/on-click hover selected edition drawing-path? drawing-tool space? selrect z?) on-context-menu (actions/on-context-menu hover hover-ids workspace-read-only?) - on-double-click (actions/on-double-click hover hover-ids drawing-path? base-objects edition drawing-tool z? workspace-read-only?) + on-double-click (actions/on-double-click hover hover-ids hover-top-frame-id drawing-path? base-objects edition drawing-tool z? workspace-read-only?) on-drag-enter (actions/on-drag-enter) on-drag-over (actions/on-drag-over) on-drop (actions/on-drop file) @@ -204,7 +204,8 @@ (>= zoom 8)) show-text-editor? (and editing-shape (= :text (:type editing-shape))) - hover-grid? (and (some? @hover-top-frame-id) (ctl/grid-layout? objects @hover-top-frame-id)) + hover-grid? (and (some? @hover-top-frame-id) + (ctl/grid-layout? objects @hover-top-frame-id)) show-grid-editor? (and editing-shape (ctl/grid-layout? editing-shape)) show-presence? page-id diff --git a/frontend/src/app/main/ui/workspace/viewport/actions.cljs b/frontend/src/app/main/ui/workspace/viewport/actions.cljs index f9ec1e96a..a1b70a021 100644 --- a/frontend/src/app/main/ui/workspace/viewport/actions.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/actions.cljs @@ -187,10 +187,10 @@ (st/emit! (dw/increase-zoom pt))))))))) (defn on-double-click - [hover hover-ids drawing-path? objects edition drawing-tool z? workspace-read-only?] + [hover hover-ids hover-top-frame-id drawing-path? objects edition drawing-tool z? workspace-read-only?] (mf/use-callback - (mf/deps @hover @hover-ids drawing-path? edition drawing-tool @z? workspace-read-only?) + (mf/deps @hover @hover-ids @hover-top-frame-id drawing-path? edition drawing-tool @z? workspace-read-only?) (fn [event] (dom/stop-propagation event) (when-not @z? @@ -214,8 +214,8 @@ (st/emit! (dw/select-shape id) (dw/start-editing-selected)) - (ctl/grid-layout? shape) - (st/emit! (dw/start-edition-mode id)) + (ctl/grid-layout? objects @hover-top-frame-id) + (st/emit! (dw/start-edition-mode @hover-top-frame-id)) :else (let [;; We only get inside childrens of the hovering shape