Scrolling to a comment not visible by default did not work
authorMarcel Werk <burntime@woltlab.com>
Fri, 6 May 2022 15:49:54 +0000 (17:49 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 6 May 2022 15:49:54 +0000 (17:49 +0200)
wcfsetup/install/files/js/WCF.Comment.js

index 43ec8d1867153fa78aa868383e39778a6ad11ea7..94065cb20cabf2c67aed2db4c1563564348bf12f 100644 (file)
@@ -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);
        },
        
        /**