Skip to content

Commit 295fb3e

Browse files
Merge pull request #20120 from calixteman/remove_actions_button
[Editor] Don't show the actions button in the comment popup when it's useless
2 parents 542514e + efc1654 commit 295fb3e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

web/comment_manager.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ class CommentManager {
177177
}
178178
}
179179

180+
#renderActionsButton(visible) {
181+
this.#actions.classList.toggle("hidden", !visible);
182+
}
183+
180184
#makeMenu() {
181185
this.#actions.addEventListener("click", e => {
182186
const closeMenu = this.#closeMenu.bind(this);
@@ -275,8 +279,10 @@ class CommentManager {
275279
);
276280
this.#commentText = text || "";
277281
if (!text) {
282+
this.#renderActionsButton(false);
278283
this.#edit();
279284
} else {
285+
this.#renderActionsButton(true);
280286
this.#setText(text);
281287
this.#textInput.classList.toggle("hidden", true);
282288
this.#textView.classList.toggle("hidden", false);
@@ -352,7 +358,7 @@ class CommentManager {
352358

353359
textInput.classList.toggle("hidden", false);
354360
textView.classList.toggle("hidden", true);
355-
this.#editMenuItem.disabled = this.#deleteMenuItem.disabled = true;
361+
this.#editMenuItem.disabled = true;
356362
setTimeout(() => textInput.focus(), 0);
357363
}
358364

0 commit comments

Comments
 (0)