Merge pull request #20120 from calixteman/remove_actions_button

[Editor] Don't show the actions button in the comment popup when it's useless
This commit is contained in:
Tim van der Meij 2025-07-27 14:24:17 +02:00 committed by GitHub
commit 295fb3ec4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}