forked from retoor/devplacepy
fix: correct typo in progress tracking variable name from Progss to Progress
This commit is contained in:
@@ -11,6 +11,7 @@ class Application {
|
||||
|
||||
this.initFormDisable();
|
||||
this.initContentRenderer();
|
||||
this.initCommentReply();
|
||||
this.initEmojiPickers();
|
||||
}
|
||||
|
||||
@@ -195,6 +196,33 @@ class Application {
|
||||
contentRenderer.highlightAll();
|
||||
}
|
||||
|
||||
initCommentReply() {
|
||||
document.querySelectorAll(".comment-action-btn").forEach((btn) => {
|
||||
if (btn.textContent.trim() !== "Reply") return;
|
||||
btn.addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
const comment = btn.closest(".comment");
|
||||
const commentForm = document.querySelector(".comment-form");
|
||||
if (!comment || !commentForm) return;
|
||||
const textarea = commentForm.querySelector("textarea");
|
||||
if (!textarea) return;
|
||||
let parentInput = commentForm.querySelector('input[name="parent_uid"]');
|
||||
if (!parentInput) {
|
||||
parentInput = document.createElement("input");
|
||||
parentInput.type = "hidden";
|
||||
parentInput.name = "parent_uid";
|
||||
commentForm.appendChild(parentInput);
|
||||
}
|
||||
const commentBody = comment.querySelector(".comment-body");
|
||||
if (commentBody && commentBody.dataset.commentUid) {
|
||||
parentInput.value = commentBody.dataset.commentUid;
|
||||
}
|
||||
textarea.focus();
|
||||
textarea.scrollIntoView({ behavior: "smooth" });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
initEmojiPickers() {
|
||||
document.querySelectorAll(".comment-form textarea, .emoji-picker-target").forEach((textarea) => {
|
||||
if (textarea.dataset.emojiInitialized) return;
|
||||
|
||||
Reference in New Issue
Block a user