       (when
         (and
           (= :loaded (:current-state @data))
-          (> 100
-            (- (.. js/document -body -offsetHeight)
-               (+ (.. js/window -innerHeight)
-                  (.. js/window -scrollY)))))
+          (let [body (.. js/document -body)
+                html  (.. js/document -documentElement)
+                height (max (.. body -scrollHeight)
+                            (.. body -offsetHeight)
+                            (.. html -clientHeight)
+                            (.. html -scrollHeight)
+                            (.. html -offsetHeight)
+                            )]
+            (> 100
+               (- height
+                  (+ (.. js/window -innerHeight)
+                     (.. js/window -scrollY))))))
         (om/transact! data #(assoc % :current-state :loading))
         (go (async-search @data ajax-chan))))))
 

              ; 200 response - ok
              (put! ajax-chan {:error false
                               :search-term search-term
                               :items (js->clj (.. % -response) :keywordize-keys true)})
              ; otherwise error
              (put! ajax-chan {:error true})))))


    om/IRenderState
    (render-state [this state]
      (dom/div nil
               (dom/h1 nil "Tumblr img Search")
               ; input
               (dom/input
                 #js {:type "text" 
