diff --git a/frontend/resources/styles/common/base.scss b/frontend/resources/styles/common/base.scss index 1d7d21886..ee3ea713b 100644 --- a/frontend/resources/styles/common/base.scss +++ b/frontend/resources/styles/common/base.scss @@ -221,3 +221,7 @@ input[type=number]::-webkit-inner-spin-button, -webkit-appearance: none; margin: 0; } + +input[type=number] { + -moz-appearance: textfield; +} diff --git a/frontend/resources/styles/main/layouts/main-layout.scss b/frontend/resources/styles/main/layouts/main-layout.scss index b9b62ef03..9c3c18c15 100644 --- a/frontend/resources/styles/main/layouts/main-layout.scss +++ b/frontend/resources/styles/main/layouts/main-layout.scss @@ -21,6 +21,7 @@ & .library-bar { grid-row: 2; grid-column: 1 / span 2; + overflow: hidden; } & .dashboard-content { diff --git a/frontend/resources/styles/main/partials/library-bar.scss b/frontend/resources/styles/main/partials/library-bar.scss index a7a2c1492..655390e8b 100644 --- a/frontend/resources/styles/main/partials/library-bar.scss +++ b/frontend/resources/styles/main/partials/library-bar.scss @@ -8,11 +8,20 @@ .library-bar { background-color: $color-white; + .sidebar-team { + display: flex; + flex-direction: column; + padding: $size-4 0; + border-top: 1px solid $color-gray-10; + height: 100%; + padding-bottom: 2.8rem; + } + .library-bar-inside { - border-right: 1px solid $color-gray-10; display: flex; flex-direction: column; height: 100%; + border-right: 1px solid $color-gray-10; .library-tabs { align-items: center; @@ -47,13 +56,14 @@ } .library-elements { - border-top: 1px solid $color-gray-10; display: flex; flex-direction: column; - height: calc(95% - 1rem); - margin-bottom: $size-4; overflow-y: auto; - padding: $size-4 0; + margin: 0; + + &.library-common { + overflow: unset; + } li { align-items: center; diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 8de92b734..5592e223a 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -1020,7 +1020,8 @@ ptk/UpdateEvent (update [_ state] (let [mdata {:position position - :shape shape}] + :shape shape + :selected (get-in state [:workspace-local :selected])}] (-> state (assoc-in [:workspace-local :context-menu] mdata)))) @@ -1328,6 +1329,7 @@ "ctrl+shift+z" #(st/emit! dwc/redo) "ctrl+y" #(st/emit! dwc/redo) "ctrl+q" #(st/emit! dwc/reinitialize-undo) + "a" #(st/emit! (select-for-drawing :frame)) "b" #(st/emit! (select-for-drawing :rect)) "e" #(st/emit! (select-for-drawing :circle)) "t" #(st/emit! (select-for-drawing :text)) diff --git a/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs b/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs index 54c696291..e8e8ad25c 100644 --- a/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs +++ b/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs @@ -96,36 +96,39 @@ library? (and (str/starts-with? (name selected-section) "dashboard-library") (= selected-team-id (:default-team-id profile))) locale (i18n/use-locale)] - [:ul.library-elements - [:li.recent-projects - {:on-click #(st/emit! (rt/nav :dashboard-team {:team-id team-id})) - :class-name (when home? "current")} - i/recent - [:span.element-title (t locale "dashboard.sidebar.recent")]] + [:div.sidebar-team + [:ul.library-elements.library-common + [:li.recent-projects + {:on-click #(st/emit! (rt/nav :dashboard-team {:team-id team-id})) + :class-name (when home? "current")} + i/recent + [:span.element-title (t locale "dashboard.sidebar.recent")]] - [:li - {:on-click #(st/emit! (rt/nav :dashboard-project {:team-id team-id - :project-id "drafts"})) - :class-name (when drafts? "current")} - i/file-html - [:span.element-title (t locale "dashboard.sidebar.drafts")]] + [:li + {:on-click #(st/emit! (rt/nav :dashboard-project {:team-id team-id + :project-id "drafts"})) + :class-name (when drafts? "current")} + i/file-html + [:span.element-title (t locale "dashboard.sidebar.drafts")]] - - [:li - {:on-click #(st/emit! (rt/nav :dashboard-library-icons-index {:team-id team-id})) - :class-name (when library? "current")} - i/icon-set - [:span.element-title (t locale "dashboard.sidebar.libraries")]] + [:li + {:on-click #(st/emit! (rt/nav :dashboard-library-icons-index {:team-id team-id})) + :class-name (when library? "current")} + i/icon-set + [:span.element-title (t locale "dashboard.sidebar.libraries")]]] [:div.projects-row [:span "PROJECTS"] [:a.btn-icon-light.btn-small {:on-click #(st/emit! dsh/create-project)} i/close]] - [:& sidebar-projects - {:selected-team-id selected-team-id - :selected-project-id selected-project-id - :team-id team-id}]])) + [:ul.library-elements + [:& sidebar-projects + {:selected-team-id selected-team-id + :selected-project-id selected-project-id + :team-id team-id}]]] + + )) (def debounced-emit! (f/debounce st/emit! 500)) diff --git a/frontend/src/uxbox/main/ui/workspace/context_menu.cljs b/frontend/src/uxbox/main/ui/workspace/context_menu.cljs index b2f6921ab..16445a6ba 100644 --- a/frontend/src/uxbox/main/ui/workspace/context_menu.cljs +++ b/frontend/src/uxbox/main/ui/workspace/context_menu.cljs @@ -90,7 +90,7 @@ :shortcut "g" :on-click do-create-group}]) - (when (and (= (count selected)) (= (:type shape) :group)) + (when (and (= (count selected) 1) (= (:type shape) :group)) [:& menu-entry {:title "Ungroup" :shortcut "Shift + g" :on-click do-remove-group}]) diff --git a/frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs b/frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs index 6b30180c8..224a66b17 100644 --- a/frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs +++ b/frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs @@ -125,7 +125,7 @@ (:hidden item)) nil - (.-ctrlKey event) + (.-shiftKey event) (st/emit! (dw/select-shape id true)) (> (count selected) 1) diff --git a/frontend/src/uxbox/main/ui/workspace/viewport.cljs b/frontend/src/uxbox/main/ui/workspace/viewport.cljs index dae03277b..0b68030b0 100644 --- a/frontend/src/uxbox/main/ui/workspace/viewport.cljs +++ b/frontend/src/uxbox/main/ui/workspace/viewport.cljs @@ -311,6 +311,7 @@ on-drop (fn [event] + (dom/prevent-default event) (let [shape (dom/get-data-transfer event) point (gpt/point (.-clientX event) (.-clientY event)) viewport-coord (translate-point-to-viewport point) diff --git a/frontend/src/uxbox/util/dom.cljs b/frontend/src/uxbox/util/dom.cljs index a0c882b07..ec491c9ee 100644 --- a/frontend/src/uxbox/util/dom.cljs +++ b/frontend/src/uxbox/util/dom.cljs @@ -165,11 +165,11 @@ (defn set-data-transfer [event data] (let [data-string (ts/encode data)] - (-> event .-dataTransfer (.setData "text" data-string)))) + (-> event .-dataTransfer (.setData "text/plain" data-string)))) (defn get-data-transfer [event] - (let [data-string (-> event .-dataTransfer (.getData "text"))] + (let [data-string (-> event .-dataTransfer (.getData "text/plain"))] (ts/decode data-string))) (defn fullscreen?