From abe3f69675f298b39ebd2d166b485f9dccd212e5 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Fri, 6 May 2022 17:49:54 +0200 Subject: [PATCH] Scrolling to a comment not visible by default did not work --- wcfsetup/install/files/js/WCF.Comment.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.Comment.js b/wcfsetup/install/files/js/WCF.Comment.js index 43ec8d1867..94065cb20c 100644 --- a/wcfsetup/install/files/js/WCF.Comment.js +++ b/wcfsetup/install/files/js/WCF.Comment.js @@ -755,11 +755,9 @@ WCF.Comment.Handler = Class.extend({ } }); } - - //noinspection BadExpressionStatementJS - comment.offsetTop; - - comment.classList.add('commentHighlightTarget'); + else { + this._scrollTo(comment, true); + } }, _insertResponse: function(data) { @@ -777,10 +775,7 @@ WCF.Comment.Handler = Class.extend({ elRemove(this._permalinkResponse); this._permalinkResponse = response; - //noinspection BadExpressionStatementJS - response.offsetTop; - - response.classList.add('commentHighlightTarget'); + this._scrollTo(response, true); }, /** -- 2.20.1