mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-16 00:05:56 +00:00
Article.cdmScrollToId: disable smooth scrolling in collapsed combined mode
This commit is contained in:
@@ -278,13 +278,14 @@ define(["dojo/_base/declare"], function (declare) {
|
|||||||
cdmScrollToId: function (id, force, event) {
|
cdmScrollToId: function (id, force, event) {
|
||||||
const ctr = $("headlines-frame");
|
const ctr = $("headlines-frame");
|
||||||
const e = $("RROW-" + id);
|
const e = $("RROW-" + id);
|
||||||
|
const is_expanded = App.getInitParam("cdm_expanded");
|
||||||
|
|
||||||
if (!e || !ctr) return;
|
if (!e || !ctr) return;
|
||||||
|
|
||||||
if (force || e.offsetTop + e.offsetHeight > (ctr.scrollTop + ctr.offsetHeight) ||
|
if (force || is_expanded || e.offsetTop + e.offsetHeight > (ctr.scrollTop + ctr.offsetHeight) ||
|
||||||
e.offsetTop < ctr.scrollTop) {
|
e.offsetTop < ctr.scrollTop) {
|
||||||
|
|
||||||
if (event && event.repeat) {
|
if (event && event.repeat || !is_expanded) {
|
||||||
ctr.addClassName("forbid-smooth-scroll");
|
ctr.addClassName("forbid-smooth-scroll");
|
||||||
window.clearTimeout(this._scroll_reset_timeout);
|
window.clearTimeout(this._scroll_reset_timeout);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user