summaryrefslogtreecommitdiff
path: root/js/Headlines.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-05-09 08:16:12 +0300
committerAndrew Dolgov <[email protected]>2020-05-09 08:16:12 +0300
commita802649d5397da0bdeaceddf3a9a38093053bcba (patch)
tree19229f8cd4a22a42d9cab4b276a701ab08e8bf85 /js/Headlines.js
parent2558fcbe21f009e8fd9b18d9d1407bf4e6115443 (diff)
rename cdmScrollToId to cdmMoveToId
prevent smooth scrolling when going directly to an article
Diffstat (limited to 'js/Headlines.js')
-rwxr-xr-xjs/Headlines.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/js/Headlines.js b/js/Headlines.js
index 79eecd79f..83ac03bc8 100755
--- a/js/Headlines.js
+++ b/js/Headlines.js
@@ -185,7 +185,7 @@ define(["dojo/_base/declare"], function (declare) {
Headlines.toggleUnread(id, 0);
} else {
- Article.cdmScrollToId(id);
+ Article.cdmMoveToId(id);
}
} else if (in_body) {
@@ -333,7 +333,7 @@ define(["dojo/_base/declare"], function (declare) {
ft.setAttribute("data-article-id", id);
ft.innerHTML = header.innerHTML;
- ft.select(".dijitCheckBox")[0].outerHTML = "<i class=\"material-icons icon-anchor\" onclick=\"Article.cdmScrollToId(" + id + ", true)\">expand_more</i>";
+ ft.select(".dijitCheckBox")[0].outerHTML = "<i class=\"material-icons icon-anchor\" onclick=\"Article.cdmMoveToId(" + id + ")\">expand_more</i>";
this.initFloatingMenu();
@@ -415,7 +415,7 @@ define(["dojo/_base/declare"], function (declare) {
new_row.addClassName("active");
if (App.isCombinedMode())
- Article.cdmScrollToId(id, true, null, true);
+ Article.cdmMoveToId(id, {noscroll: true});
else
Article.view(id);
}
@@ -884,11 +884,11 @@ define(["dojo/_base/declare"], function (declare) {
//const row = $("RROW-" + Article.getActive());
const ctr = $("headlines-frame");
- if (!noscroll) {
- Article.scroll(ctr.offsetHeight / 2, event);
- } else if (next_id) {
+ if (noscroll) {
Article.setActive(next_id);
- Article.cdmScrollToId(next_id, true, event);
+ Article.cdmMoveToId(next_id, { event: event, noscroll: noscroll });
+ } else if (next_id) {
+ Article.scroll(ctr.offsetHeight / 2, event);
}
} else if (next_id) {
@@ -906,15 +906,15 @@ define(["dojo/_base/declare"], function (declare) {
//const prev_row = $("RROW-" + prev_id);
const ctr = $("headlines-frame");
- if (!noscroll) {
- Article.scroll(-ctr.offsetHeight / 2, event);
- } else {
+ if (noscroll) {
if (row && Math.round(row.offsetTop) < Math.round(ctr.scrollTop)) {
- Article.cdmScrollToId(Article.getActive(), noscroll, event);
+ Article.cdmMoveToId(Article.getActive(), { force: noscroll, event: event });
} else if (prev_id) {
Article.setActive(prev_id);
- Article.cdmScrollToId(prev_id, noscroll, event);
+ Article.cdmMoveToId(prev_id, { force: noscroll, event: event, noscroll: noscroll });
}
+ } else {
+ Article.scroll(-ctr.offsetHeight / 2, event);
}
} else if (prev_id) {