From 2a4573842d20b1acefc7a9b8c0dfd0cfdacd0af3 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 19 May 2020 14:25:31 +0200 Subject: [PATCH] :sparkles: Small change to frame labels --- frontend/src/uxbox/main/refs.cljs | 1 - frontend/src/uxbox/main/ui/components/dropdown.cljs | 4 ++-- .../src/uxbox/main/ui/components/editable_select.cljs | 2 +- frontend/src/uxbox/main/ui/workspace/shapes/frame.cljs | 2 +- .../uxbox/main/ui/workspace/sidebar/options/frame.cljs | 8 ++++---- .../main/ui/workspace/sidebar/options/frame_grid.cljs | 4 ++-- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend/src/uxbox/main/refs.cljs b/frontend/src/uxbox/main/refs.cljs index 84d72442f4..2437461b37 100644 --- a/frontend/src/uxbox/main/refs.cljs +++ b/frontend/src/uxbox/main/refs.cljs @@ -74,7 +74,6 @@ (def workspace-saved-grids (l/derived :saved-grids workspace-page-options)) - (def workspace-objects (l/derived :objects workspace-data)) diff --git a/frontend/src/uxbox/main/ui/components/dropdown.cljs b/frontend/src/uxbox/main/ui/components/dropdown.cljs index eae0f817d0..48f8f6d867 100644 --- a/frontend/src/uxbox/main/ui/components/dropdown.cljs +++ b/frontend/src/uxbox/main/ui/components/dropdown.cljs @@ -43,8 +43,8 @@ (mf/defc dropdown {::mf/wrap-props false} [props] - #_(assert (fn? (gobj/get props "on-close")) "missing `on-close` prop") - #_(assert (boolean? (gobj/get props "show")) "missing `show` prop") + (assert (fn? (gobj/get props "on-close")) "missing `on-close` prop") + (assert (boolean? (gobj/get props "show")) "missing `show` prop") (when (gobj/get props "show") (mf/element dropdown' props))) diff --git a/frontend/src/uxbox/main/ui/components/editable_select.cljs b/frontend/src/uxbox/main/ui/components/editable_select.cljs index 57093c6cb4..5d2994d4c9 100644 --- a/frontend/src/uxbox/main/ui/components/editable_select.cljs +++ b/frontend/src/uxbox/main/ui/components/editable_select.cljs @@ -55,7 +55,7 @@ :type type}] [:span.dropdown-button {:on-click open-dropdown} i/arrow-down] - [:& dropdown {:show (:is-open? @state) + [:& dropdown {:show (get @state :is-open? false) :on-close close-dropdown} [:ul.custom-select-dropdown (for [[index item] (map-indexed vector options)] diff --git a/frontend/src/uxbox/main/ui/workspace/shapes/frame.cljs b/frontend/src/uxbox/main/ui/workspace/shapes/frame.cljs index 28cadea2c0..e39abfe6c1 100644 --- a/frontend/src/uxbox/main/ui/workspace/shapes/frame.cljs +++ b/frontend/src/uxbox/main/ui/workspace/shapes/frame.cljs @@ -71,7 +71,7 @@ childs (mapv #(get objects %) (:shapes shape)) ds-modifier (get-in shape [:modifiers :displacement]) - label-pos (gpt/point x (- y 10)) + label-pos (gpt/point x (- y (/ 10 zoom))) on-double-click (mf/use-callback diff --git a/frontend/src/uxbox/main/ui/workspace/sidebar/options/frame.cljs b/frontend/src/uxbox/main/ui/workspace/sidebar/options/frame.cljs index 13d525922b..1dabf3e554 100644 --- a/frontend/src/uxbox/main/ui/workspace/sidebar/options/frame.cljs +++ b/frontend/src/uxbox/main/ui/workspace/sidebar/options/frame.cljs @@ -38,10 +38,10 @@ on-orientation-clicked (fn [orientation] - (let [width (:width shape) - height (:height shape) - new-width (if (= orientation :horiz) (max width height) (min width height)) - new-height (if (= orientation :horiz) (min width height) (max width height))] + (let [width (:width shape) + height (:height shape) + new-width (if (= orientation :horiz) (max width height) (min width height)) + new-height (if (= orientation :horiz) (min width height) (max width height))] (st/emit! (udw/update-rect-dimensions (:id shape) :width new-width) (udw/update-rect-dimensions (:id shape) :height new-height)))) diff --git a/frontend/src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs b/frontend/src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs index 29588bad5c..5e2fc522f5 100644 --- a/frontend/src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs +++ b/frontend/src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs @@ -180,8 +180,8 @@ (when (#{:row :column} type) [:& input-row {:label (if (= :row type) - (t locale "workspace.options.grid.params.width") - (t locale "workspace.options.grid.params.height")) + (t locale "workspace.options.grid.params.height") + (t locale "workspace.options.grid.params.width")) :class "pixels" :value (or (:item-length params) "") :on-change handle-change-item-length}])