From e51adc2b5fb311cacc70e6ce7777cb1c393bcec9 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 29 Jan 2016 20:07:20 +0200 Subject: [PATCH] Minor renaming for consistency. --- src/uxbox/ui/workspace/base.cljs | 2 +- src/uxbox/ui/workspace/canvas.cljs | 2 +- src/uxbox/ui/workspace/canvas/movement.cljs | 2 +- src/uxbox/ui/workspace/recent_colors.cljs | 10 +--------- src/uxbox/ui/workspace/toolboxes/layers.cljs | 4 ++-- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/uxbox/ui/workspace/base.cljs b/src/uxbox/ui/workspace/base.cljs index 7d3ec2883..39d701eea 100644 --- a/src/uxbox/ui/workspace/base.cljs +++ b/src/uxbox/ui/workspace/base.cljs @@ -43,7 +43,7 @@ (as-> (l/in [:workspace :flags]) $ (l/focus-atom $ st/state))) -(def ^:static shapes-by-id +(def ^:static shapes-by-id-l (as-> (l/key :shapes-by-id) $ (l/focus-atom $ st/state))) diff --git a/src/uxbox/ui/workspace/canvas.cljs b/src/uxbox/ui/workspace/canvas.cljs index 27fd46e80..3375a8481 100644 --- a/src/uxbox/ui/workspace/canvas.cljs +++ b/src/uxbox/ui/workspace/canvas.cljs @@ -139,7 +139,7 @@ (defn- canvas-render [own {:keys [width height id] :as page}] (let [workspace (rum/react wb/workspace-l) - shapes-by-id (rum/react wb/shapes-by-id) + shapes-by-id (rum/react wb/shapes-by-id-l) workspace-selected (:selected workspace) xf (comp (map #(get shapes-by-id %)) diff --git a/src/uxbox/ui/workspace/canvas/movement.cljs b/src/uxbox/ui/workspace/canvas/movement.cljs index d2bbeed78..281ee234f 100644 --- a/src/uxbox/ui/workspace/canvas/movement.cljs +++ b/src/uxbox/ui/workspace/canvas/movement.cljs @@ -11,7 +11,7 @@ (letfn [(on-value [delta] (let [pageid (get-in @st/state [:workspace :page]) selected (get-in @st/state [:workspace :selected]) - shapes (->> (vals @wb/shapes-by-id) + shapes (->> (vals @wb/shapes-by-id-l) (filter #(= (:page %) pageid)) (filter (comp selected :id)))] (doseq [{:keys [id group]} shapes] diff --git a/src/uxbox/ui/workspace/recent_colors.cljs b/src/uxbox/ui/workspace/recent_colors.cljs index 2eebdefb2..595fba0ea 100644 --- a/src/uxbox/ui/workspace/recent_colors.cljs +++ b/src/uxbox/ui/workspace/recent_colors.cljs @@ -11,14 +11,6 @@ [uxbox.ui.dom :as dom] [uxbox.ui.workspace.base :as wb])) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Lenses -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(def ^:static ^:private shapes-by-id - (as-> (l/key :shapes-by-id) $ - (l/focus-atom $ st/state))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -48,7 +40,7 @@ (defn- recent-colors-render [own {:keys [page id] :as shape} callback] - (let [shapes-by-id (rum/react shapes-by-id) + (let [shapes-by-id (rum/react wb/shapes-by-id-l) shapes (->> (vals shapes-by-id) (filter #(= (:page %) page))) colors (calculate-colors shapes)] diff --git a/src/uxbox/ui/workspace/toolboxes/layers.cljs b/src/uxbox/ui/workspace/toolboxes/layers.cljs index 595772715..afa3a3a54 100644 --- a/src/uxbox/ui/workspace/toolboxes/layers.cljs +++ b/src/uxbox/ui/workspace/toolboxes/layers.cljs @@ -125,7 +125,7 @@ toggle-open (fn [event] (dom/stop-propagation event) (swap! local assoc :open (not open?))) - shapes-by-id (rum/react wb/shapes-by-id)] + shapes-by-id (rum/react wb/shapes-by-id-l)] (html [:li.group {:class (when open? "open")} [:div.element-list-body @@ -168,7 +168,7 @@ [own] (let [workspace (rum/react wb/workspace-l) selected (:selected workspace) - shapes-by-id (rum/react wb/shapes-by-id) + shapes-by-id (rum/react wb/shapes-by-id-l) page (rum/react (focus-page (:page workspace))) close #(rs/emit! (dw/toggle-toolbox :layers)) ;; copy #(rs/emit! (dw/copy-selected))