[Editor] Don't show the actions button in the comment popup when it's useless
This commit is contained in:
parent
542514efbd
commit
efc1654326
@ -177,6 +177,10 @@ class CommentManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#renderActionsButton(visible) {
|
||||||
|
this.#actions.classList.toggle("hidden", !visible);
|
||||||
|
}
|
||||||
|
|
||||||
#makeMenu() {
|
#makeMenu() {
|
||||||
this.#actions.addEventListener("click", e => {
|
this.#actions.addEventListener("click", e => {
|
||||||
const closeMenu = this.#closeMenu.bind(this);
|
const closeMenu = this.#closeMenu.bind(this);
|
||||||
@ -275,8 +279,10 @@ class CommentManager {
|
|||||||
);
|
);
|
||||||
this.#commentText = text || "";
|
this.#commentText = text || "";
|
||||||
if (!text) {
|
if (!text) {
|
||||||
|
this.#renderActionsButton(false);
|
||||||
this.#edit();
|
this.#edit();
|
||||||
} else {
|
} else {
|
||||||
|
this.#renderActionsButton(true);
|
||||||
this.#setText(text);
|
this.#setText(text);
|
||||||
this.#textInput.classList.toggle("hidden", true);
|
this.#textInput.classList.toggle("hidden", true);
|
||||||
this.#textView.classList.toggle("hidden", false);
|
this.#textView.classList.toggle("hidden", false);
|
||||||
@ -352,7 +358,7 @@ class CommentManager {
|
|||||||
|
|
||||||
textInput.classList.toggle("hidden", false);
|
textInput.classList.toggle("hidden", false);
|
||||||
textView.classList.toggle("hidden", true);
|
textView.classList.toggle("hidden", true);
|
||||||
this.#editMenuItem.disabled = this.#deleteMenuItem.disabled = true;
|
this.#editMenuItem.disabled = true;
|
||||||
setTimeout(() => textInput.focus(), 0);
|
setTimeout(() => textInput.focus(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user