From 98402ae1dbf898ff9efb602bb53a2467b1160b25 Mon Sep 17 00:00:00 2001 From: Andrew Zhurov Date: Wed, 27 Jul 2022 13:41:20 +0300 Subject: [PATCH] :tada: Add zoom to shape on double click upon its icon in navigation pane Signed-off-by: Andrei Zhurau --- frontend/src/app/main/ui/workspace/sidebar/layers.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/layers.cljs b/frontend/src/app/main/ui/workspace/sidebar/layers.cljs index 05ad9bdfd..3510a0c3b 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/layers.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/layers.cljs @@ -218,7 +218,10 @@ :icon-layer (= (:type item) :icon)) :on-click select-shape :on-double-click #(dom/stop-propagation %)} - [:& si/element-icon {:shape item}] + [:div {:on-double-click #(do (dom/stop-propagation %) + (dom/prevent-default %) + (st/emit! dw/zoom-to-selected-shape))} + [:& si/element-icon {:shape item}]] [:& layer-name {:shape item :name-ref ref :on-start-edit #(reset! disable-drag true)