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