Merge pull request #237 from uxbox/bug-fixing

Bug fixing
This commit is contained in:
Hirunatan 2020-06-03 10:22:40 +02:00 committed by GitHub
commit e1ae3da41e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 53 additions and 32 deletions

View file

@ -221,3 +221,7 @@ input[type=number]::-webkit-inner-spin-button,
-webkit-appearance: none; -webkit-appearance: none;
margin: 0; margin: 0;
} }
input[type=number] {
-moz-appearance: textfield;
}

View file

@ -21,6 +21,7 @@
& .library-bar { & .library-bar {
grid-row: 2; grid-row: 2;
grid-column: 1 / span 2; grid-column: 1 / span 2;
overflow: hidden;
} }
& .dashboard-content { & .dashboard-content {

View file

@ -8,11 +8,20 @@
.library-bar { .library-bar {
background-color: $color-white; 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 { .library-bar-inside {
border-right: 1px solid $color-gray-10;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
border-right: 1px solid $color-gray-10;
.library-tabs { .library-tabs {
align-items: center; align-items: center;
@ -47,13 +56,14 @@
} }
.library-elements { .library-elements {
border-top: 1px solid $color-gray-10;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: calc(95% - 1rem);
margin-bottom: $size-4;
overflow-y: auto; overflow-y: auto;
padding: $size-4 0; margin: 0;
&.library-common {
overflow: unset;
}
li { li {
align-items: center; align-items: center;

View file

@ -1020,7 +1020,8 @@
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
(let [mdata {:position position (let [mdata {:position position
:shape shape}] :shape shape
:selected (get-in state [:workspace-local :selected])}]
(-> state (-> state
(assoc-in [:workspace-local :context-menu] mdata)))) (assoc-in [:workspace-local :context-menu] mdata))))
@ -1328,6 +1329,7 @@
"ctrl+shift+z" #(st/emit! dwc/redo) "ctrl+shift+z" #(st/emit! dwc/redo)
"ctrl+y" #(st/emit! dwc/redo) "ctrl+y" #(st/emit! dwc/redo)
"ctrl+q" #(st/emit! dwc/reinitialize-undo) "ctrl+q" #(st/emit! dwc/reinitialize-undo)
"a" #(st/emit! (select-for-drawing :frame))
"b" #(st/emit! (select-for-drawing :rect)) "b" #(st/emit! (select-for-drawing :rect))
"e" #(st/emit! (select-for-drawing :circle)) "e" #(st/emit! (select-for-drawing :circle))
"t" #(st/emit! (select-for-drawing :text)) "t" #(st/emit! (select-for-drawing :text))

View file

@ -96,7 +96,8 @@
library? (and (str/starts-with? (name selected-section) "dashboard-library") library? (and (str/starts-with? (name selected-section) "dashboard-library")
(= selected-team-id (:default-team-id profile))) (= selected-team-id (:default-team-id profile)))
locale (i18n/use-locale)] locale (i18n/use-locale)]
[:ul.library-elements [:div.sidebar-team
[:ul.library-elements.library-common
[:li.recent-projects [:li.recent-projects
{:on-click #(st/emit! (rt/nav :dashboard-team {:team-id team-id})) {:on-click #(st/emit! (rt/nav :dashboard-team {:team-id team-id}))
:class-name (when home? "current")} :class-name (when home? "current")}
@ -110,22 +111,24 @@
i/file-html i/file-html
[:span.element-title (t locale "dashboard.sidebar.drafts")]] [:span.element-title (t locale "dashboard.sidebar.drafts")]]
[:li [:li
{:on-click #(st/emit! (rt/nav :dashboard-library-icons-index {:team-id team-id})) {:on-click #(st/emit! (rt/nav :dashboard-library-icons-index {:team-id team-id}))
:class-name (when library? "current")} :class-name (when library? "current")}
i/icon-set i/icon-set
[:span.element-title (t locale "dashboard.sidebar.libraries")]] [:span.element-title (t locale "dashboard.sidebar.libraries")]]]
[:div.projects-row [:div.projects-row
[:span "PROJECTS"] [:span "PROJECTS"]
[:a.btn-icon-light.btn-small {:on-click #(st/emit! dsh/create-project)} [:a.btn-icon-light.btn-small {:on-click #(st/emit! dsh/create-project)}
i/close]] i/close]]
[:ul.library-elements
[:& sidebar-projects [:& sidebar-projects
{:selected-team-id selected-team-id {:selected-team-id selected-team-id
:selected-project-id selected-project-id :selected-project-id selected-project-id
:team-id team-id}]])) :team-id team-id}]]]
))
(def debounced-emit! (f/debounce st/emit! 500)) (def debounced-emit! (f/debounce st/emit! 500))

View file

@ -90,7 +90,7 @@
:shortcut "g" :shortcut "g"
:on-click do-create-group}]) :on-click do-create-group}])
(when (and (= (count selected)) (= (:type shape) :group)) (when (and (= (count selected) 1) (= (:type shape) :group))
[:& menu-entry {:title "Ungroup" [:& menu-entry {:title "Ungroup"
:shortcut "Shift + g" :shortcut "Shift + g"
:on-click do-remove-group}]) :on-click do-remove-group}])

View file

@ -125,7 +125,7 @@
(:hidden item)) (:hidden item))
nil nil
(.-ctrlKey event) (.-shiftKey event)
(st/emit! (dw/select-shape id true)) (st/emit! (dw/select-shape id true))
(> (count selected) 1) (> (count selected) 1)

View file

@ -311,6 +311,7 @@
on-drop on-drop
(fn [event] (fn [event]
(dom/prevent-default event)
(let [shape (dom/get-data-transfer event) (let [shape (dom/get-data-transfer event)
point (gpt/point (.-clientX event) (.-clientY event)) point (gpt/point (.-clientX event) (.-clientY event))
viewport-coord (translate-point-to-viewport point) viewport-coord (translate-point-to-viewport point)

View file

@ -165,11 +165,11 @@
(defn set-data-transfer (defn set-data-transfer
[event data] [event data]
(let [data-string (ts/encode data)] (let [data-string (ts/encode data)]
(-> event .-dataTransfer (.setData "text" data-string)))) (-> event .-dataTransfer (.setData "text/plain" data-string))))
(defn get-data-transfer (defn get-data-transfer
[event] [event]
(let [data-string (-> event .-dataTransfer (.getData "text"))] (let [data-string (-> event .-dataTransfer (.getData "text/plain"))]
(ts/decode data-string))) (ts/decode data-string)))
(defn fullscreen? (defn fullscreen?