0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 16:30:37 -05:00

🚧 Track FIXME for color palette

This commit is contained in:
mathieu.brunot 2019-02-24 00:00:32 +01:00
parent e6e9f5160e
commit fd9adca1a9
No known key found for this signature in database
GPG key ID: 81584BEAF692D7E0
2 changed files with 9 additions and 5 deletions

View file

@ -98,6 +98,7 @@
transition: all .6s ease;
width: 100%;
overflow-x: scroll;
scroll-behavior: smooth;
}
.color-cell {

View file

@ -87,25 +87,28 @@
[:div.btn-palette.edit.current i/pencil]
[:div.btn-palette.create i/close]]]
;; FIXME Scroll on click does not work
[:span.left-arrow {}
;; FIXME
(when (> offset 0)
{:on-click #(swap! local (fnil dec 1) offset)})
{:on-click #(.scrollBy (dom/get-element "color-palette-inside") (- offset) 0)})
i/arrow-slide]
[:div.color-palette-content {:ref "container"}
[:div.color-palette-inside {:style {:position "relative"
[:div.color-palette-inside {:id "color-palette-inside"
:ref "color-palette-inside"
:style {:position "relative"
:right (str (* 86 offset) "px")}}
(mx/doseq [color colors]
(-> (palette-item color)
(mx/with-key color)))]]
;; FIXME Scroll on click does not work
[:span.right-arrow
;; FIXME
(if (< offset invisible)
{:on-click #(swap! local (fnil inc 0) offset)}
{:on-click #(.scrollBy (dom/get-element "color-palette-inside") offset 0)}
{})
i/arrow-slide]
[:span.close-palette {:on-click close}
i/close]])))