fix dashboard grid visual bug

This commit is contained in:
elhombretecla 2016-05-06 08:08:33 +02:00
parent a9d38db076
commit 1391c9e671
5 changed files with 125 additions and 113 deletions

View file

@ -66,6 +66,14 @@
overflow: scroll; overflow: scroll;
width: 100%; width: 100%;
.dashboard-grid-row {
align-items: center;
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 100%;
}
.grid-item { .grid-item {
align-items: center; align-items: center;
border-radius: $br-medium; border-radius: $br-medium;

View file

@ -133,6 +133,7 @@
[:section.dashboard-grid.library [:section.dashboard-grid.library
(page-title coll) (page-title coll)
[:div.dashboard-grid-content [:div.dashboard-grid-content
[:div.dashboard-grid-row
(when own? (when own?
[:div.grid-item.small-item.add-project [:div.grid-item.small-item.add-project
{:on-click #(udl/open! :color-form {:coll coll})} {:on-click #(udl/open! :color-form {:coll coll})}
@ -149,7 +150,7 @@
{:on-click #(edit-cb color)} i/pencil] {:on-click #(edit-cb color)} i/pencil]
[:div.project-th-icon.delete [:div.project-th-icon.delete
{:on-click #(remove-cb color)} {:on-click #(remove-cb color)}
i/trash]])])]])))) i/trash]])])]]]))))
(def ^:const ^:private grid (def ^:const ^:private grid
(mx/component (mx/component

View file

@ -41,6 +41,7 @@
[own] [own]
(html (html
[:div.dashboard-grid-content [:div.dashboard-grid-content
[:div.dashboard-grid-row
[:div.grid-item.add-project [:div.grid-item.add-project
{on-click #(udl/open! :new-element)} {on-click #(udl/open! :new-element)}
[:span "+ New element"]] [:span "+ New element"]]
@ -121,7 +122,7 @@
[:h3 "Custom element"] [:h3 "Custom element"]
[:div.project-th-actions [:div.project-th-actions
[:div.project-th-icon.edit i/pencil] [:div.project-th-icon.edit i/pencil]
[:div.project-th-icon.delete i/trash]]]])) [:div.project-th-icon.delete i/trash]]]]]))
(def ^:const ^:private grid (def ^:const ^:private grid
(mx/component (mx/component

View file

@ -108,13 +108,14 @@
[:section.dashboard-grid.library [:section.dashboard-grid.library
(page-title coll) (page-title coll)
[:div.dashboard-grid-content [:div.dashboard-grid-content
[:div.dashboard-grid-row
(for [icon (:icons coll)] (for [icon (:icons coll)]
[:div.grid-item.small-item.project-th {} [:div.grid-item.small-item.project-th {}
[:span.grid-item-image #_i/toggle (uusc/render-shape-svg icon nil)] [:span.grid-item-image #_i/toggle (uusc/render-shape-svg icon nil)]
[:h3 (:name icon)] [:h3 (:name icon)]
#_[:div.project-th-actions #_[:div.project-th-actions
[:div.project-th-icon.edit i/pencil] [:div.project-th-icon.edit i/pencil]
[:div.project-th-icon.delete i/trash]]])]])))) [:div.project-th-icon.delete i/trash]]])]]]))))
(def grid (def grid
(mx/component (mx/component

View file

@ -200,6 +200,7 @@
[:section.dashboard-grid [:section.dashboard-grid
[:h2 "Your projects"] [:h2 "Your projects"]
[:div.dashboard-grid-content [:div.dashboard-grid-content
[:div.dashboard-grid-row
[:div.grid-item.add-project [:div.grid-item.add-project
{:on-click on-click} {:on-click on-click}
[:span "+ New project"]] [:span "+ New project"]]
@ -207,7 +208,7 @@
(dp/filter-projects-by filtering) (dp/filter-projects-by filtering)
(dp/sort-projects-by ordering))] (dp/sort-projects-by ordering))]
(-> (grid-item item) (-> (grid-item item)
(rum/with-key (:id item))))]])))) (rum/with-key (:id item))))]]]))))
(def grid (def grid
(mx/component (mx/component