1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 18:35:57 +00:00

rename cdmScrollToId to cdmMoveToId

prevent smooth scrolling when going directly to an article
This commit is contained in:
Andrew Dolgov
2020-05-09 08:16:12 +03:00
parent 2558fcbe21
commit a802649d53
3 changed files with 20 additions and 16 deletions

View File

@@ -290,7 +290,11 @@ define(["dojo/_base/declare"], function (declare) {
dialog.show();
},
cdmScrollToId: function (id, force, event, immediate) {
cdmMoveToId: function (id, params) {
const force = params.force || true;
const event = params.event || null;
const noscroll = params.noscroll || false;
const ctr = $("headlines-frame");
const e = $("RROW-" + id);
const is_expanded = App.getInitParam("cdm_expanded");
@@ -300,7 +304,7 @@ define(["dojo/_base/declare"], function (declare) {
if (force || is_expanded || e.offsetTop + e.offsetHeight > (ctr.scrollTop + ctr.offsetHeight) ||
e.offsetTop < ctr.scrollTop) {
if (immediate || event && event.repeat || !is_expanded) {
if (noscroll || event && event.repeat || !is_expanded) {
ctr.addClassName("forbid-smooth-scroll");
window.clearTimeout(this._scroll_reset_timeout);