summaryrefslogtreecommitdiff
path: root/offline.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-04 14:47:09 +0300
committerAndrew Dolgov <[email protected]>2009-02-04 14:47:09 +0300
commit0e923da4bd1c2f2d567c4b73770f0793404a62b2 (patch)
treee12df861c4439808749da1c5255ec6786cf08889 /offline.js
parent10003c4c2e17d088b96dc3b5381fd60523ca39ed (diff)
offline: disable infscroll when no new headlines are available; misc fixes
Diffstat (limited to 'offline.js')
-rw-r--r--offline.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/offline.js b/offline.js
index e5f129055..8480035e5 100644
--- a/offline.js
+++ b/offline.js
@@ -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);