diff --git a/src/uxbox/ui/workspace.cljs b/src/uxbox/ui/workspace.cljs index 332801c936..c7af34d834 100644 --- a/src/uxbox/ui/workspace.cljs +++ b/src/uxbox/ui/workspace.cljs @@ -19,23 +19,6 @@ [uxbox.ui.workspace.colorpalette :refer (colorpalette)] [uxbox.ui.workspace.canvas :refer (viewport)])) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Coordinates Debug -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defn- coordenates-render - [own] - (let [{:keys [x y]} (rum/react wb/mouse-canvas-a)] - (html - [:div {:style {:position "absolute" :left "50px" :top "25px"}} - [:span (str "| x=" x " | y=" y " |")]]))) - -(def coordinates - (mx/component - {:render coordenates-render - :name "coordenates" - :mixins [rum/reactive]})) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Workspace ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/src/uxbox/ui/workspace/header.cljs b/src/uxbox/ui/workspace/header.cljs index 28e6502170..b43c4f3399 100644 --- a/src/uxbox/ui/workspace/header.cljs +++ b/src/uxbox/ui/workspace/header.cljs @@ -9,7 +9,32 @@ [uxbox.ui.icons :as i] [uxbox.ui.users :as ui.u] [uxbox.ui.navigation :as nav] - [uxbox.ui.mixins :as mx])) + [uxbox.ui.mixins :as mx] + [uxbox.util.math :as mth])) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Coordinates Debug +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defn- coordenates-render + [own] + (let [{:keys [x y]} (rum/react wb/mouse-canvas-a) + x (mth/precision x 1) + y (mth/precision y 1)] + (html + [:ul.options-btn + [:li.tooltip.tooltip-bottom {:alt "x"} x] + [:li.tooltip.tooltip-bottom {:alt "y"} y]]))) + +(def coordinates + (mx/component + {:render coordenates-render + :name "coordenates" + :mixins [rum/reactive]})) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Header +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn on-download-clicked [event page] @@ -87,7 +112,8 @@ [:ul.options-btn [:li.tooltip.tooltip-bottom {:alt "Multi-canvas (Ctrl + M)"} - i/multicanvas]]] + i/multicanvas]] + (coordinates)] (ui.u/user)]))) (def header