diff --git a/js/Feeds.js b/js/Feeds.js index 44d48d6c7..487f5bafe 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -282,6 +282,7 @@ define(["dojo/_base/declare"], function (declare) { const is_cat = !!params.is_cat || false; const offset = params.offset || 0; const viewfeed_debug = params.viewfeed_debug; + const append = params.append || false; const method = params.method; // this is used to quickly switch between feeds, sets active but xhr is on a timeout const delayed = params.delayed || false; @@ -349,7 +350,7 @@ define(["dojo/_base/declare"], function (declare) { try { window.clearTimeout(this._infscroll_timeout); this.setExpando(feed, is_cat, 'images/blank_icon.gif'); - Headlines.onLoaded(transport, offset); + Headlines.onLoaded(transport, offset, append); PluginHost.run(PluginHost.HOOK_FEED_LOADED, [feed, is_cat]); } catch (e) { App.Error.report(e); diff --git a/js/Headlines.js b/js/Headlines.js index 783067f30..c9eac0696 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -218,7 +218,7 @@ define(["dojo/_base/declare"], function (declare) { console.log("loadMore, offset=", offset); - Feeds.open({feed: Feeds.getActive(), is_cat: Feeds.activeIsCat(), offset: offset}); + Feeds.open({feed: Feeds.getActive(), is_cat: Feeds.activeIsCat(), offset: offset, append: true}); }, scrollHandler: function () { try { @@ -529,10 +529,10 @@ define(["dojo/_base/declare"], function (declare) { return tmp.firstChild; }, - onLoaded: function (transport, offset) { + onLoaded: function (transport, offset, append) { const reply = App.handleRpcJson(transport); - console.log("Headlines.onLoaded: offset=", offset); + console.log("Headlines.onLoaded: offset=", offset, "append=", append); let is_cat = false; let feed_id = false; @@ -573,7 +573,7 @@ define(["dojo/_base/declare"], function (declare) { //this.vgroup_last_feed = reply['headlines-info']['vgroup_last_feed']; this.current_first_id = reply['headlines']['first_id']; - if (offset == 0) { + if (!append) { //this.headlines = []; this.vgroup_last_feed = undefined;