From c52bc1010a96706c8779226e05ecbe20c387cdd3 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Sat, 4 Dec 2021 22:23:57 +0200 Subject: [PATCH] Fixup "Groups: Add the ability to write comments on behalf of the group" Sorry, I just forgot to add this file to the commit :3 --- Web/static/js/al_comments.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Web/static/js/al_comments.js b/Web/static/js/al_comments.js index 03875a39..516cbdc0 100644 --- a/Web/static/js/al_comments.js +++ b/Web/static/js/al_comments.js @@ -1,9 +1,12 @@ 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 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) - inputbox.text("[id" + authorId + "|" + authorNm + "], "); + inputbox.text("[" + (fromGroup ? "club" : "id") + "" + authorId + "|" + authorNm + "], "); inputbox.trigger("focusin"); });