summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/feedlist.js6
-rw-r--r--js/viewfeed.js48
2 files changed, 27 insertions, 27 deletions
diff --git a/js/feedlist.js b/js/feedlist.js
index 0bfb6b6a7..6284534db 100644
--- a/js/feedlist.js
+++ b/js/feedlist.js
@@ -1,5 +1,7 @@
var _infscroll_disable = 0;
var _infscroll_request_sent = 0;
+var _infscroll_tmp_disable = 0;
+
var _search_query = false;
var _viewfeed_last = 0;
var _viewfeed_timeout = false;
@@ -13,7 +15,9 @@ function viewCategory(cat) {
function loadMoreHeadlines() {
try {
- console.log("loadMoreHeadlines");
+ console.log("loadMoreHeadlines: " + _infscroll_tmp_disable);
+
+ if (_infscroll_tmp_disable) return;
var offset = 0;
diff --git a/js/viewfeed.js b/js/viewfeed.js
index 522952304..e1425a382 100644
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -46,7 +46,7 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
return;
}
- if (feed_id != getActiveFeedId() || is_cat != activeFeedIsCat())
+ if (feed_id != -7 && (feed_id != getActiveFeedId() || is_cat != activeFeedIsCat()))
return;
/* dijit.getEnclosingWidget(
@@ -90,19 +90,12 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
reply['headlines']['toolbar'],
{parseContent: true});
- dijit.byId("headlines-frame").attr("content", "");
-
- reply['headlines']['content'].each(function(row) {
- if (loaded_article_ids.indexOf(row.id) == -1) {
- loaded_article_ids.push(row.id);
- }
-
- var tmp = new Element("div");
- tmp.innerHTML = row.html;
-
- dojo.parser.parse(tmp.firstChild);
- dijit.byId("headlines-frame").domNode.appendChild(tmp.firstChild);
+ dojo.html.set($("headlines-frame"),
+ reply['headlines']['content'],
+ {parseContent: true});
+ $$("#headlines-frame div[id*='RROW']").each(function(row) {
+ loaded_article_ids.push(row.id);
});
var hsp = $("headlines-spacer");
@@ -134,26 +127,25 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
if (hsp)
c.domNode.removeChild(hsp);
- reply['headlines']['content'].each(function(row) {
- if (loaded_article_ids.indexOf(row.id) == -1 || row.kind == 'feed_title') {
- loaded_article_ids.push(row.id);
-
- var tmp = new Element("div");
- tmp.innerHTML = row.html;
+ var tmp = new Element("div");
+ tmp.innerHTML = reply['headlines']['content'];
+ dojo.parser.parse(tmp);
- dojo.parser.parse(tmp.firstChild);
- dijit.byId("headlines-frame").domNode.appendChild(tmp.firstChild);
+ while (tmp.hasChildNodes()) {
+ var row = tmp.removeChild(tmp.firstChild);
+ if (loaded_article_ids.indexOf(row.id) == -1 || row.hasClassName("cdmFeedTitle")) {
+ dijit.byId("headlines-frame").domNode.appendChild(row);
+ Element.hide(row);
+ new Effect.Appear(row, {duration:0.5});
+ loaded_article_ids.push(row.id);
}
- });
-
+ }
if (!hsp) hsp = new Element("DIV", {"id": "headlines-spacer"});
c.domNode.appendChild(hsp);
- console.log("added " + reply['headlines']['content'].size() + " headlines");
-
- if (reply['headlines']['content'].size() == 0) _infscroll_disable = true;
+ if (headlines_count < 30) _infscroll_disable = true;
console.log("restore selected ids: " + ids);
@@ -1392,6 +1384,8 @@ function catchupBatchedArticles() {
reply = JSON.parse(transport.responseText);
var batch = reply.ids;
+ _infscroll_tmp_disable = 1;
+
batch.each(function(id) {
console.log(id);
var elem = $("RROW-" + id);
@@ -1399,6 +1393,8 @@ function catchupBatchedArticles() {
catchup_id_batch.remove(id);
});
+ _infscroll_tmp_disable = 0;
+
updateFloatingTitle(true);
} });