From: Alexander Ebert Date: Fri, 25 Aug 2017 15:58:45 +0000 (+0200) Subject: Fixed response loading via anchor X-Git-Tag: 3.1.0_Alpha_2~23 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=005b2ff11a88411f8d60878ec8ff5bb61a224644;p=GitHub%2FWoltLab%2FWCF.git Fixed response loading via anchor Fixes #2400 --- diff --git a/wcfsetup/install/files/js/WCF.Comment.js b/wcfsetup/install/files/js/WCF.Comment.js index 24745ef56c..acd0bdf073 100644 --- a/wcfsetup/install/files/js/WCF.Comment.js +++ b/wcfsetup/install/files/js/WCF.Comment.js @@ -877,8 +877,6 @@ WCF.Comment.Handler = Class.extend({ return; } - // TODO: handle 'response' value - $(data.returnValues.template).insertBefore(this._permalinkComment); var comment = this._permalinkComment.previousElementSibling; comment.classList.add('commentPermalinkContainer'); @@ -886,6 +884,20 @@ WCF.Comment.Handler = Class.extend({ elRemove(this._permalinkComment); this._permalinkComment = comment; + if (data.returnValues.response) { + this._permalinkResponse = elCreate('li'); + this._permalinkResponse.className = 'commentResponsePermalinkContainer loading'; + this._permalinkResponse.innerHTML = ''; + var responseList = elBySel('.commentResponseList', comment); + responseList.insertBefore(this._permalinkResponse, responseList.firstChild); + + this._insertResponse({ + returnValues: { + template: data.returnValues.response + } + }); + } + //noinspection BadExpressionStatementJS comment.offsetTop; diff --git a/wcfsetup/install/files/lib/data/comment/CommentAction.class.php b/wcfsetup/install/files/lib/data/comment/CommentAction.class.php index f764ced8ce..d3b1c13310 100644 --- a/wcfsetup/install/files/lib/data/comment/CommentAction.class.php +++ b/wcfsetup/install/files/lib/data/comment/CommentAction.class.php @@ -931,8 +931,8 @@ class CommentAction extends AbstractDatabaseObjectAction implements IMessageInli } } - // load last response time for comment-only requests - if ($response === null && $comment->getDecoratedObject()->responses) { + // load last response time + if ($comment->getDecoratedObject()->responses) { $sql = "SELECT time FROM wcf".WCF_N."_comment_response WHERE commentID = ?