From 1ef5e857d7b041394e044f6dc03bf5e560e7f3d9 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 26 Mar 2021 15:20:37 +0100 Subject: [PATCH] Fix 'scroll on click' in rich text TOC and comments --- www/pad/comments.js | 2 +- www/pad/inner.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/www/pad/comments.js b/www/pad/comments.js index 8f13c2c7a..6069aa1d0 100644 --- a/www/pad/comments.js +++ b/www/pad/comments.js @@ -578,7 +578,7 @@ define([ // Scroll into view if (!$last.length) { return; } - var visible = UIElements.isVisible($last[0], Env.$inner); + var visible = UIElements.isVisible($last[0], Env.$contentContainer); if (!visible) { $last[0].scrollIntoView(); } }; diff --git a/www/pad/inner.js b/www/pad/inner.js index 96ea320bc..793d57b72 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -908,7 +908,7 @@ define([ $(a).click(function (e) { e.preventDefault(); e.stopPropagation(); - if (!obj.el || UIElements.isVisible(obj.el, $inner)) { return; } + if (!obj.el || UIElements.isVisible(obj.el, $contentContainer)) { return; } obj.el.scrollIntoView(); }); a.innerHTML = title;