From bb71d830a88fa82c78443a98d494eda550e49e60 Mon Sep 17 00:00:00 2001 From: Vitaliy Vlasov Date: Thu, 25 Jan 2018 13:43:15 +0200 Subject: [PATCH] Add page-num-active style disabling pointer cursor --- src/cljs/commiteth/common.cljs | 12 ++++++------ src/less/style.less | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/cljs/commiteth/common.cljs b/src/cljs/commiteth/common.cljs index 8cb213d..25b47b3 100644 --- a/src/cljs/commiteth/common.cljs +++ b/src/cljs/commiteth/common.cljs @@ -48,15 +48,15 @@ (defn draw-page-numbers [page-number page-count] "Draw page numbers for the pagination component. - Inserts ellipsis when list is too long, by default - max 6 items are allowed" + Inserts ellipsis when list is too long, by default + max 6 items are allowed" (let [draw-page-num-fn (fn [current? i] ^{:key i} [:div.rectangle-rounded - (cond-> {} - (not current?) - (assoc :class "grayed-out-page-num" - :on-click #(rf/dispatch [:set-page-number i]))) + (if current? + {:class "page-num-active"} + {:class "grayed-out-page-num" + :on-click #(rf/dispatch [:set-page-number i])}) i]) max-page-nums 6] [:div.page-nums-container diff --git a/src/less/style.less b/src/less/style.less index d8c078c..063f7bb 100644 --- a/src/less/style.less +++ b/src/less/style.less @@ -897,6 +897,10 @@ body { cursor: pointer; } +.page-num-active { + cursor: auto; +} + .grayed-out-page-num { color: #8d99a4; background-color: #f2f5f8;