From fd9adca1a983318d0477cb320b11686f9d6d1ca4 Mon Sep 17 00:00:00 2001 From: "mathieu.brunot" Date: Sun, 24 Feb 2019 00:00:32 +0100 Subject: [PATCH] :construction: Track FIXME for color palette --- .../styles/main/partials/color-palette.scss | 1 + .../src/uxbox/main/ui/workspace/colorpalette.cljs | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/resources/styles/main/partials/color-palette.scss b/frontend/resources/styles/main/partials/color-palette.scss index 3702f2938..d870b1a01 100644 --- a/frontend/resources/styles/main/partials/color-palette.scss +++ b/frontend/resources/styles/main/partials/color-palette.scss @@ -98,6 +98,7 @@ transition: all .6s ease; width: 100%; overflow-x: scroll; + scroll-behavior: smooth; } .color-cell { diff --git a/frontend/src/uxbox/main/ui/workspace/colorpalette.cljs b/frontend/src/uxbox/main/ui/workspace/colorpalette.cljs index a13f71c26..aea07a64d 100644 --- a/frontend/src/uxbox/main/ui/workspace/colorpalette.cljs +++ b/frontend/src/uxbox/main/ui/workspace/colorpalette.cljs @@ -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]])))