diff --git a/frontend/uxbox/ui/workspace.cljs b/frontend/uxbox/ui/workspace.cljs index bbd1405ce..34fe45b52 100644 --- a/frontend/uxbox/ui/workspace.cljs +++ b/frontend/uxbox/ui/workspace.cljs @@ -13,7 +13,8 @@ [uxbox.ui.workspace.pagesmngr :refer (pagesmngr)] [uxbox.ui.workspace.header :refer (header)] [uxbox.ui.workspace.rules :refer (h-rule v-rule)] - [uxbox.ui.workspace.workarea :refer (workarea aside)])) + [uxbox.ui.workspace.sidebar :refer (aside)] + [uxbox.ui.workspace.workarea :refer (viewport coordinates)])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Workspace @@ -21,7 +22,8 @@ (defn- workspace-render [own projectid] - (let [workspace (rum/react wb/workspace-state)] + (let [workspace (rum/react wb/workspace-state) + no-toolbars? (empty? (:toolboxes workspace))] (html [:div (header) @@ -38,10 +40,19 @@ (v-rule) ;; Canvas - (workarea)] + [:section.workspace-canvas {:class (when no-toolbars? "no-tool-bar") + :on-scroll (constantly nil)} + #_(when (:selected page) + (element-options conn + page-cursor + project-cursor + zoom-cursor + shapes-cursor)) + (coordinates) + (viewport)]] ;; Aside - (when-not (empty? (:toolboxes workspace)) + (when-not no-toolbars? (aside))]]))) (defn- workspace-will-mount diff --git a/frontend/uxbox/ui/workspace/sidebar.cljs b/frontend/uxbox/ui/workspace/sidebar.cljs new file mode 100644 index 000000000..0dca9b357 --- /dev/null +++ b/frontend/uxbox/ui/workspace/sidebar.cljs @@ -0,0 +1,33 @@ +(ns uxbox.ui.workspace.sidebar + (:require [sablono.core :as html :refer-macros [html]] + [rum.core :as rum] + [uxbox.router :as r] + [uxbox.rstore :as rs] + [uxbox.ui.mixins :as mx] + [uxbox.ui.util :as util] + [uxbox.ui.workspace.base :as wb] + [uxbox.ui.workspace.toolboxes :as toolboxes])) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Aside +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defn aside-render + [own] + (let [workspace (rum/react wb/workspace-state)] + (html + [:aside#settings-bar.settings-bar + [:div.settings-bar-inside + (when (:draw-toolbox-enabled workspace false) + (toolboxes/draw-tools)) + (when (:icons-toolbox-enabled workspace false) + (toolboxes/icons)) + (when (:layers-toolbox-enabled workspace false) + (toolboxes/layers))]]))) + +(def aside + (util/component + {:render aside-render + :name "aside" + :mixins [rum/reactive]})) + diff --git a/frontend/uxbox/ui/workspace/workarea.cljs b/frontend/uxbox/ui/workspace/workarea.cljs index 6c2b0a9c4..ff40846fb 100644 --- a/frontend/uxbox/ui/workspace/workarea.cljs +++ b/frontend/uxbox/ui/workspace/workarea.cljs @@ -4,15 +4,10 @@ [uxbox.router :as r] [uxbox.rstore :as rs] [uxbox.state :as s] - [uxbox.shapes :as shapes] - [uxbox.library.icons :as _icons] [uxbox.ui.mixins :as mx] [uxbox.ui.util :as util] - [uxbox.data.projects :as dp] [uxbox.ui.workspace.canvas :as wc] - [uxbox.ui.workspace.base :as wb] - [uxbox.ui.workspace.rules :as wr] - [uxbox.ui.workspace.toolboxes :as toolboxes])) + [uxbox.ui.workspace.base :as wb])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Coordinates Debug @@ -133,54 +128,3 @@ {:render viewport-render :name "viewport" :mixins [rum/reactive]})) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Aside -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defn aside-render - [own] - (let [workspace (rum/react wb/workspace-state)] - (html - [:aside#settings-bar.settings-bar - [:div.settings-bar-inside - (when (:draw-toolbox-enabled workspace false) - (toolboxes/draw-tools)) - (when (:icons-toolbox-enabled workspace false) - (toolboxes/icons)) - (when (:layers-toolbox-enabled workspace false) - (toolboxes/layers))]]))) - -(def aside - (util/component - {:render aside-render - :name "aside" - :mixins [rum/reactive]})) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Work Area -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defn working-area-render - [own] - (let [workspace (rum/react wb/workspace-state)] - (html - [:section.workspace-canvas - {:class (when (empty? (:toolboxes workspace)) "no-tool-bar") - :on-scroll (constantly nil)} - - #_(when (:selected page) - (element-options conn - page-cursor - project-cursor - zoom-cursor - shapes-cursor)) - (coordinates) - (viewport)]))) - -(def workarea - (util/component - {:render working-area-render - :name "workarea" - :mixins [rum/reactive]})) -