diff --git a/Web/Presenters/templates/components/comment.xml b/Web/Presenters/templates/components/comment.xml index 701db922..94122ac7 100644 --- a/Web/Presenters/templates/components/comment.xml +++ b/Web/Presenters/templates/components/comment.xml @@ -1,8 +1,9 @@ {var author = $comment->getOwner()} {var $Club = openvk\Web\Models\Entities\Club::class} +{var postId = $comment->getTarget() instanceof \openvk\Web\Models\Entities\Post ? $comment->getTarget()->getId() : NULL} - +
diff --git a/Web/static/js/al_comments.js b/Web/static/js/al_comments.js index 111b558c..21acd797 100644 --- a/Web/static/js/al_comments.js +++ b/Web/static/js/al_comments.js @@ -1,11 +1,10 @@ u(".comment-reply").on("click", function(e) { - let inputbox = u("#write textarea"); let comment = u(e.target).closest(".post"); let authorId = comment.data("owner-id"); let authorNm = u(".post-author > a > b", comment.first()).text().trim(); let fromGroup = Boolean(comment.data("from-group")); let postId = comment.data("post-id"); - console.log(postId) + let inputbox = postId == null ? u("#write textarea") : u("#wall-post-input" + (postId || "")); inputbox.text("[" + (fromGroup ? "club" : "id") + authorId + "|" + authorNm + "], "); inputbox.trigger("focusin");