]> git.wh0rd.org Git - tt-rss.git/commitdiff
offline: disable infscroll when no new headlines are available; misc fixes
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 4 Feb 2009 11:47:09 +0000 (14:47 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 4 Feb 2009 11:47:09 +0000 (14:47 +0300)
feedlist.js
offline.js

index 3cf2380470b368245bbf50a4cec3cd6c65b65da7..753307d29c6e9fcf8bf81a60d6be448b1185db08 100644 (file)
@@ -92,10 +92,10 @@ function viewNextFeedPage() {
        try {
                //if (!getActiveFeedId()) return;
 
-               debug("viewNextFeedPage: calling viewfeed(), p: " + _feed_cur_page+1);
+               debug("viewNextFeedPage: calling viewfeed(), p: " + parseInt(_feed_cur_page+1));
 
                viewfeed(getActiveFeedId(), undefined, activeFeedIsCat(), undefined,
-                       undefined, _feed_cur_page+1);
+                       undefined, parseInt(_feed_cur_page+1));
 
        } catch (e) {
                exception_error("viewNextFeedPage", e);
index e5f1290557dd6e458ea4c99908f9659f289ce070..8480035e518af591fa1a2cd77716c67ceec8a58c 100644 (file)
@@ -69,6 +69,22 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
 
                if (!offset) offset = 0;
 
+               if (offset > 0) {
+                       _feed_cur_page = parseInt(offset);
+                       if (_infscroll_request_sent) {
+                               return;
+                       }
+               } else {
+                       _feed_cur_page = 0;
+                       _infscroll_disable = 0;
+               }
+
+               if (getActiveFeedId() != feed_id) {
+                       _feed_cur_page = 0;
+                       active_post_id = 0;
+                       _infscroll_disable = 0;
+               }
+
                loading_set_progress(100);
 
                clean_feed_selections();
@@ -262,6 +278,10 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
                                line_num++;
                        }
 
+                       if (line_num - offset*30 < 30) {
+                               _infscroll_disable = 1;
+                       }
+
                        rs.close();
        
                        if (offset == 0) {
@@ -286,6 +306,7 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
 
                remove_splash();
 
+               _infscroll_request_sent = 0;
 
        } catch (e) {
                exception_error("viewfeed_offline", e);