headlines onLoaded: make sure a few more things respect append instead of offset == 0
This commit is contained in:
parent
59d1fd481d
commit
dee210e546
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue