summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-10 20:56:09 +0300
committerAndrew Dolgov <[email protected]>2018-12-10 20:56:09 +0300
commitc97c755195c1d58a550078500fc0427905e5d71c (patch)
tree05d833427a6b48a567dd35963503043a70288d7f /js
parentd9bf0f17c6ea5f37f92fe4980c45f2adf882f5e7 (diff)
remove _active_article_id; use selector instead
Diffstat (limited to 'js')
-rw-r--r--js/Article.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/js/Article.js b/js/Article.js
index 9aea53b35..0af8a0d55 100644
--- a/js/Article.js
+++ b/js/Article.js
@@ -2,7 +2,6 @@
/* global __, ngettext */
define(["dojo/_base/declare"], function (declare) {
Article = {
- _active_article_id: 0,
selectionSetScore: function () {
const ids = Headlines.getSelected();
@@ -290,8 +289,6 @@ define(["dojo/_base/declare"], function (declare) {
}
});
- this._active_article_id = id;
-
const row = $("RROW-" + id);
if (row) {
@@ -308,13 +305,18 @@ define(["dojo/_base/declare"], function (declare) {
if (cb) cb.attr("checked", true);
}
- PluginHost.run(PluginHost.HOOK_ARTICLE_SET_ACTIVE, this._active_article_id);
+ PluginHost.run(PluginHost.HOOK_ARTICLE_SET_ACTIVE, row.getAttribute("data-article-id"));
}
//Headlines.updateSelectedPrompt();
},
getActive: function () {
- return this._active_article_id;
+ const row = document.querySelector("#headlines-frame > div[id*=RROW][class*=active]");
+
+ if (row)
+ return row.getAttribute("data-article-id");
+ else
+ return 0;
},
scroll: function (offset) {
if (!App.isCombinedMode()) {