diff --git a/src/uxbox/data/workspace.cljs b/src/uxbox/data/workspace.cljs index d331a9404..eba436ae1 100644 --- a/src/uxbox/data/workspace.cljs +++ b/src/uxbox/data/workspace.cljs @@ -186,8 +186,11 @@ :height c/viewport-height :x-axis (:grid/x-axis opts c/grid-x-axis) :y-axis (:grid/y-axis opts c/grid-y-axis)}] - (->> (uw/send! worker message) - (rx/map #(activate-flag :alignment/indexed)))))) + (rx/merge + (->> (uw/send! worker message) + (rx/map #(activate-flag :grid/indexed))) + (when (:grid/align opts) + (rx/of (activate-flag :grid/alignment))))))) (defn initialize-alignment-index [id] diff --git a/src/uxbox/ui/workspace/movement.cljs b/src/uxbox/ui/workspace/movement.cljs index dda50a074..d7ae197ce 100644 --- a/src/uxbox/ui/workspace/movement.cljs +++ b/src/uxbox/ui/workspace/movement.cljs @@ -38,19 +38,13 @@ (-> (l/getter resolve-selected) (l/focus-atom st/state))) -;; (def ^:const ^:privae page-options-l -;; (-> (l/key :options) -;; (l/focus-atom wb/page-l))) - (def ^:const ^:private alignment-l - (letfn [(getter [state] - (let [{:keys [page flags]} (:workspace state) - {:keys [options]} (get-in state [:pages-by-id page])] - (and (contains? flags :alignment/indexed) - (contains? flags :grid) - (:grid/align options false))))] + (letfn [(getter [flags] + (and (contains? flags :grid/indexed) + (contains? flags :grid/alignment) + (contains? flags :grid)))] (-> (l/getter getter) - (l/focus-atom st/state)))) + (l/focus-atom wb/flags-l)))) ;; --- Public Api @@ -121,5 +115,3 @@ [delta] (doseq [shape delta] (rs/emit! (uds/update-shape shape)))) - - diff --git a/src/uxbox/ui/workspace/settings.cljs b/src/uxbox/ui/workspace/settings.cljs index 4128ed16c..3e343a7ac 100644 --- a/src/uxbox/ui/workspace/settings.cljs +++ b/src/uxbox/ui/workspace/settings.cljs @@ -46,7 +46,7 @@ (on-align-change [event] (let [checked? (-> (dom/get-target event) (dom/checked?))] - (swap! local assoc :grid/align checked?))) + (swap! local assoc :grid/alignment checked?))) (on-submit [event] (dom/prevent-default event) (let [page (assoc page :options opts)]