From efc16543268494b29bdf4964139ca2507adfa690 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Fri, 25 Jul 2025 19:47:58 +0200 Subject: [PATCH] [Editor] Don't show the actions button in the comment popup when it's useless --- web/comment_manager.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/comment_manager.js b/web/comment_manager.js index effe956f9..65907d04d 100644 --- a/web/comment_manager.js +++ b/web/comment_manager.js @@ -177,6 +177,10 @@ class CommentManager { } } + #renderActionsButton(visible) { + this.#actions.classList.toggle("hidden", !visible); + } + #makeMenu() { this.#actions.addEventListener("click", e => { const closeMenu = this.#closeMenu.bind(this); @@ -275,8 +279,10 @@ class CommentManager { ); this.#commentText = text || ""; if (!text) { + this.#renderActionsButton(false); this.#edit(); } else { + this.#renderActionsButton(true); this.#setText(text); this.#textInput.classList.toggle("hidden", true); this.#textView.classList.toggle("hidden", false); @@ -352,7 +358,7 @@ class CommentManager { textInput.classList.toggle("hidden", false); textView.classList.toggle("hidden", true); - this.#editMenuItem.disabled = this.#deleteMenuItem.disabled = true; + this.#editMenuItem.disabled = true; setTimeout(() => textInput.focus(), 0); }