From 25c84677534f9c97eca77498177aa5afb74142b2 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 17 May 2020 17:01:52 +0300 Subject: [PATCH] rename Headlines.correctHeadlinesOffset() to scrollToArticleId() invoke it in Article.view() instead of all over the place --- js/Article.js | 3 ++- js/Headlines.js | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/js/Article.js b/js/Article.js index 91b2b4b36..b0021f47b 100644 --- a/js/Article.js +++ b/js/Article.js @@ -139,7 +139,7 @@ define(["dojo/_base/declare"], function (declare) { c.attr('content', article); PluginHost.run(PluginHost.HOOK_ARTICLE_RENDERED, c.domNode); - Headlines.correctHeadlinesOffset(Article.getActive()); + //Headlines.correctHeadlinesOffset(Article.getActive()); try { c.focus(); @@ -198,6 +198,7 @@ define(["dojo/_base/declare"], function (declare) { }, view: function (id, noexpand) { this.setActive(id); + Headlines.scrollToArticleId(id); if (!noexpand) { const hl = Headlines.objectById(id); diff --git a/js/Headlines.js b/js/Headlines.js index be08f32eb..6b77472e3 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -835,7 +835,6 @@ define(["dojo/_base/declare"], function (declare) { Article.setActive(next_id); Article.cdmMoveToId(next_id, {event: event, noscroll: noscroll}); } else { - Headlines.correctHeadlinesOffset(next_id); Article.view(next_id, noexpand); } } @@ -855,7 +854,6 @@ define(["dojo/_base/declare"], function (declare) { } } else if (prev_id) { - Headlines.correctHeadlinesOffset(prev_id); Article.view(prev_id, noexpand); } } @@ -1193,7 +1191,7 @@ define(["dojo/_base/declare"], function (declare) { eval(elem.value); elem.attr('value', 'false'); }, - correctHeadlinesOffset: function (id) { + scrollToArticleId: function (id) { const container = $("headlines-frame"); const row = $("RROW-" + id);