summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-18 07:51:00 +0300
committerAndrew Dolgov <[email protected]>2018-12-18 07:51:00 +0300
commitdee210e5460da5e8da63ea6c8004fdfdd0f38e22 (patch)
tree523cdfff25d886922803675bc28dafdbf1c95356 /js
parent59d1fd481d1b00bc2c328959baa322e8601e72da (diff)
headlines onLoaded: make sure a few more things respect append instead of offset == 0
Diffstat (limited to 'js')
-rwxr-xr-xjs/Headlines.js37
1 files changed, 18 insertions, 19 deletions
diff --git a/js/Headlines.js b/js/Headlines.js
index c9eac0696..2b1eb79a4 100755
--- a/js/Headlines.js
+++ b/js/Headlines.js
@@ -539,9 +539,6 @@ define(["dojo/_base/declare"], function (declare) {
if (reply) {
- if (offset == 0)
- Article.setActive(0);
-
is_cat = reply['headlines']['is_cat'];
feed_id = reply['headlines']['id'];
Feeds.last_search_query = reply['headlines']['search_query'];
@@ -549,22 +546,6 @@ define(["dojo/_base/declare"], function (declare) {
if (feed_id != -7 && (feed_id != Feeds.getActive() || is_cat != Feeds.activeIsCat()))
return;
- try {
- if (offset == 0) {
- $("headlines-frame").scrollTop = 0;
-
- Element.hide("floatingTitle");
- $("floatingTitle").setAttribute("data-article-id", 0);
- $("floatingTitle").innerHTML = "";
- }
- } catch (e) {
- }
-
- $("headlines-frame").removeClassName("cdm");
- $("headlines-frame").removeClassName("normal");
-
- $("headlines-frame").addClassName(App.isCombinedMode() ? "cdm" : "normal");
-
const headlines_count = reply['headlines-info']['count'];
Feeds.infscroll_disabled = parseInt(headlines_count) != 30;
@@ -574,6 +555,24 @@ define(["dojo/_base/declare"], function (declare) {
this.current_first_id = reply['headlines']['first_id'];
if (!append) {
+
+ $("headlines-frame").removeClassName("cdm");
+ $("headlines-frame").removeClassName("normal");
+
+ $("headlines-frame").addClassName(App.isCombinedMode() ? "cdm" : "normal");
+
+ Article.setActive(0);
+
+ try {
+ $("headlines-frame").scrollTop = 0;
+
+ Element.hide("floatingTitle");
+ $("floatingTitle").setAttribute("data-article-id", 0);
+ $("floatingTitle").innerHTML = "";
+ } catch (e) {
+ console.warn(e);
+ }
+
//this.headlines = [];
this.vgroup_last_feed = undefined;