Skip to content

Commit

Permalink
[Editor] Don't show the alt-text button when the alt-text dialog is v…
Browse files Browse the repository at this point in the history
…isible

This way, the button doens't cover the image.
  • Loading branch information
calixteman committed Sep 25, 2023
1 parent 57d196e commit 72e2a02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/display/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@ class AnnotationEditor {
altText.addEventListener(
"click",
event => {
this.#altTextButton.hidden = true;
event.preventDefault();
this._uiManager.editAltText(this);
},
Expand Down Expand Up @@ -919,6 +920,10 @@ class AnnotationEditor {
}
}

altTextFinish() {
this.#altTextButton.hidden = false;
}

getClientDimensions() {
return this.div.getBoundingClientRect();
}
Expand Down
1 change: 1 addition & 0 deletions web/alt_text_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ class AltTextManager {
this.#removeOnClickListeners();
this.#uiManager?.addEditListeners();
this.#eventBus._off("resize", this.#boundSetPosition);
this.#currentEditor.altTextFinish();
this.#currentEditor = null;
this.#uiManager = null;
}
Expand Down

0 comments on commit 72e2a02

Please sign in to comment.