Headlines.click: do not set article active if it already is

Headlines.onLoaded: reset active article if not called in append mode
This commit is contained in:
Andrew Dolgov 2018-12-05 07:41:55 +03:00
parent 2621180b54
commit 9814ac608c
2 changed files with 8 additions and 8 deletions

View File

@ -303,11 +303,6 @@ define(["dojo/_base/declare"], function (declare) {
// this is used to quickly switch between feeds, sets active but xhr is on a timeout
const delayed = params.delayed || false;
if (feed != this.getActive() || this.activeIsCat() != is_cat) {
this._search_query = false;
Article.setActive(0);
}
if (offset != 0) {
if (this.infscroll_in_progress)
return;

View File

@ -16,10 +16,12 @@ define(["dojo/_base/declare"], function (declare) {
Article.openInNewWindow(id);
}
if (Article.getActive() != id) {
Article.setActive(id);
if (!App.getInitParam("cdm_expanded"))
Article.cdmScrollToId(id);
}
return in_body;
@ -231,6 +233,9 @@ 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'];