]> git.wh0rd.org Git - tt-rss.git/commitdiff
tweak infscroll threshold
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 10 Sep 2012 17:00:35 +0000 (21:00 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 10 Sep 2012 17:00:35 +0000 (21:00 +0400)
js/viewfeed.js

index c38d9d55530df0bd6929013adfe5a8c20a3a1657..9e43e29cc94e0e45344fb66b3a1706c2ec1ef3fd 100644 (file)
@@ -305,7 +305,9 @@ function article_callback2(transport, id) {
 
                request_counters();
 
-               try {
+               headlines_scroll_handler($("headlines-frame"));
+
+/*             try {
                        if (!_infscroll_disable &&
                                        $$("#headlines-frame > div[id*=RROW]").last().hasClassName("Selected")) {
 
@@ -313,7 +315,7 @@ function article_callback2(transport, id) {
                        }
                } catch (e) {
                        console.warn(e);
-               }
+               } */
 
                notify("");
        } catch (e) {
@@ -382,7 +384,7 @@ function view(id) {
                        // the server roundtrip altogether
                        if (cids_to_request.length == 0) {
 
-                               try {
+/*                             try {
                                        if (!_infscroll_disable &&
                                                $$("#headlines-frame > div[id*=RROW]").last().hasClassName("Selected")) {
 
@@ -390,7 +392,9 @@ function view(id) {
                                        }
                                } catch (e) {
                                        console.warn(e);
-                               }
+                               } */
+
+                               headlines_scroll_handler($("headlines-frame"));
 
                                return;
                        }
@@ -1113,8 +1117,9 @@ function headlines_scroll_handler(e) {
                var hsp = $("headlines-spacer");
 
                if (!_infscroll_disable) {
-                       if (hsp && (e.scrollTop + e.offsetHeight > hsp.offsetTop) ||
-                                       e.scrollTop + e.offsetHeight > e.scrollHeight - 100) {
+                       if ((hsp && e.scrollTop + e.offsetHeight > hsp.offsetTop) ||
+                                       (e.scrollHeight != 0 &&
+                                               ((e.scrollTop + e.offsetHeight) / e.scrollHeight >= 0.7))) {
 
                                if (hsp)
                                        hsp.innerHTML = "<img src='images/indicator_tiny.gif'> " +