Merge pull request #17825 from calixteman/bug1886964
[Editor] Add a label to the highight floating button readable with NVDA (bug 1886964)
This commit is contained in:
commit
14307c04dd
@ -318,8 +318,10 @@ pdfjs-editor-stamp-button-label = Add or edit images
|
|||||||
pdfjs-editor-highlight-button =
|
pdfjs-editor-highlight-button =
|
||||||
.title = Highlight
|
.title = Highlight
|
||||||
pdfjs-editor-highlight-button-label = Highlight
|
pdfjs-editor-highlight-button-label = Highlight
|
||||||
pdfjs-highlight-floating-button =
|
pdfjs-highlight-floating-button1 =
|
||||||
.title = Highlight
|
.title = Highlight
|
||||||
|
.aria-label = Highlight
|
||||||
|
pdfjs-highlight-floating-button-label = Highlight
|
||||||
|
|
||||||
## Remove button for the various kind of editor.
|
## Remove button for the various kind of editor.
|
||||||
|
|
||||||
|
|||||||
@ -202,7 +202,11 @@ class HighlightToolbar {
|
|||||||
const button = document.createElement("button");
|
const button = document.createElement("button");
|
||||||
button.className = "highlightButton";
|
button.className = "highlightButton";
|
||||||
button.tabIndex = 0;
|
button.tabIndex = 0;
|
||||||
button.setAttribute("data-l10n-id", `pdfjs-highlight-floating-button`);
|
button.setAttribute("data-l10n-id", `pdfjs-highlight-floating-button1`);
|
||||||
|
const span = document.createElement("span");
|
||||||
|
button.append(span);
|
||||||
|
span.className = "visuallyHidden";
|
||||||
|
span.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button-label");
|
||||||
button.addEventListener("contextmenu", noContextMenu);
|
button.addEventListener("contextmenu", noContextMenu);
|
||||||
button.addEventListener("click", () => {
|
button.addEventListener("click", () => {
|
||||||
this.#uiManager.highlightSelection("floating_button");
|
this.#uiManager.highlightSelection("floating_button");
|
||||||
|
|||||||
@ -52,6 +52,8 @@
|
|||||||
* for screen readers. */
|
* for screen readers. */
|
||||||
.visuallyHidden {
|
.visuallyHidden {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user