From 3813e191508a48d1a74c885a7fc19087cb4f6994 Mon Sep 17 00:00:00 2001 From: Vitaliy Vlasov Date: Fri, 26 Jan 2018 12:46:50 +0200 Subject: [PATCH] Add check for container-element --- src/cljs/commiteth/common.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cljs/commiteth/common.cljs b/src/cljs/commiteth/common.cljs index f89e5e1..1213395 100644 --- a/src/cljs/commiteth/common.cljs +++ b/src/cljs/commiteth/common.cljs @@ -45,7 +45,8 @@ {:class "grayed-out-page-num" :on-click #(do (rf/dispatch [:set-page-number i]) - (.scrollIntoView @container-element))}) + (when @container-element + (.scrollIntoView @container-element)))}) i]) max-page-nums 6] [:div.page-nums-container @@ -97,7 +98,8 @@ (if forward? (inc page-number) (dec page-number))]) - (.scrollIntoView @container-element))) + (when @container-element + (.scrollIntoView @container-element)))) draw-rect (fn [direction] (let [forward? (= direction :forward) gray-out? (or (and forward? (= page-number page-count))