Pagination: add cursor pointer for buttons;
scroll to top when changing page
This commit is contained in:
parent
7d7d781f06
commit
03ab5b0539
|
@ -59,6 +59,7 @@
|
|||
|
||||
(defn activity-list [activity-page-data]
|
||||
[:div.ui.container.activity-container
|
||||
{:id "activity-container"}
|
||||
(if (empty? (:items activity-page-data))
|
||||
[:div.view-no-data-container
|
||||
[:p "No recent activity yet"]]
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
(defn bounties-list [{:keys [items item-count page-number total-count]
|
||||
:as bounty-page-data}]
|
||||
[:div.ui.container.open-bounties-container
|
||||
{:id "open-bounties-container"}
|
||||
[:div.open-bounties-header "Bounties"]
|
||||
(if (empty? items)
|
||||
[:div.view-no-data-container
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
reg-fx
|
||||
inject-cofx]]
|
||||
[ajax.core :refer [GET POST]]
|
||||
[clojure.browser.dom :as dom :refer [get-element]]
|
||||
[cuerdas.core :as str]
|
||||
[cljs-web3.core :as web3]
|
||||
[cljs-web3.eth :as web3-eth]
|
||||
|
@ -38,6 +39,15 @@
|
|||
(println "redirecting to" path)
|
||||
(set! (.-pathname js/location) path)))
|
||||
|
||||
(reg-fx
|
||||
:bounty-scroll-pos
|
||||
(fn [scroll-pos]
|
||||
(.scrollIntoView (get-element "open-bounties-container")) ))
|
||||
|
||||
(reg-fx
|
||||
:activity-scroll-pos
|
||||
(fn [scroll-pos]
|
||||
(.scrollIntoView (get-element "activity-container"))))
|
||||
|
||||
(reg-event-fx
|
||||
:initialize-db
|
||||
|
@ -68,15 +78,17 @@
|
|||
(fn [db [_ page]]
|
||||
(assoc db :page page)))
|
||||
|
||||
(reg-event-db
|
||||
(reg-event-fx
|
||||
:set-bounty-page-number
|
||||
(fn [db [_ page]]
|
||||
(assoc db :bounty-page-number page)))
|
||||
(fn [{:keys [db]} [_ page]]
|
||||
{:db (assoc db :bounty-page-number page)
|
||||
:bounty-scroll-pos 0}))
|
||||
|
||||
(reg-event-db
|
||||
(reg-event-fx
|
||||
:set-activity-page-number
|
||||
(fn [db [_ page]]
|
||||
(assoc db :activity-page-number page)))
|
||||
(fn [{:keys [db]} [_ page]]
|
||||
{:db (assoc db :activity-page-number page)
|
||||
:activity-scroll-pos 0}))
|
||||
|
||||
(reg-event-fx
|
||||
:set-flash-message
|
||||
|
|
|
@ -887,6 +887,7 @@ body {
|
|||
flex: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.grayed-out {
|
||||
|
|
Loading…
Reference in New Issue