From: Marcel Werk Date: Fri, 6 May 2022 15:49:54 +0000 (+0200) Subject: Scrolling to a comment not visible by default did not work X-Git-Tag: 5.5.0_Beta_1~12^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=abe3f69675f298b39ebd2d166b485f9dccd212e5;p=GitHub%2FWoltLab%2FWCF.git Scrolling to a comment not visible by default did not work --- 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); }, /**