Add check for container-element
This commit is contained in:
parent
dbffabffe0
commit
3813e19150
|
@ -45,7 +45,8 @@
|
||||||
{:class "grayed-out-page-num"
|
{:class "grayed-out-page-num"
|
||||||
:on-click #(do
|
:on-click #(do
|
||||||
(rf/dispatch [:set-page-number i])
|
(rf/dispatch [:set-page-number i])
|
||||||
(.scrollIntoView @container-element))})
|
(when @container-element
|
||||||
|
(.scrollIntoView @container-element)))})
|
||||||
i])
|
i])
|
||||||
max-page-nums 6]
|
max-page-nums 6]
|
||||||
[:div.page-nums-container
|
[:div.page-nums-container
|
||||||
|
@ -97,7 +98,8 @@
|
||||||
(if forward?
|
(if forward?
|
||||||
(inc page-number)
|
(inc page-number)
|
||||||
(dec page-number))])
|
(dec page-number))])
|
||||||
(.scrollIntoView @container-element)))
|
(when @container-element
|
||||||
|
(.scrollIntoView @container-element))))
|
||||||
draw-rect (fn [direction]
|
draw-rect (fn [direction]
|
||||||
(let [forward? (= direction :forward)
|
(let [forward? (= direction :forward)
|
||||||
gray-out? (or (and forward? (= page-number page-count))
|
gray-out? (or (and forward? (= page-number page-count))
|
||||||
|
|
Loading…
Reference in New Issue