Don't manually convert setAttribute
values to strings (PR 14554 follow-up)
According to MDN, see https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute#parameters, non-string values will be automatically converted into strings. I should probably have read that article more carefully, to avoid unnecessary churn in the code; sorry about that!
This commit is contained in:
parent
54d4d345d3
commit
f1b17773c0
@ -223,10 +223,10 @@ class PDFSidebar {
|
|||||||
this.attachmentsButton.classList.toggle("toggled", isAttachments);
|
this.attachmentsButton.classList.toggle("toggled", isAttachments);
|
||||||
this.layersButton.classList.toggle("toggled", isLayers);
|
this.layersButton.classList.toggle("toggled", isLayers);
|
||||||
|
|
||||||
this.thumbnailButton.setAttribute("aria-checked", `${isThumbs}`);
|
this.thumbnailButton.setAttribute("aria-checked", isThumbs);
|
||||||
this.outlineButton.setAttribute("aria-checked", `${isOutline}`);
|
this.outlineButton.setAttribute("aria-checked", isOutline);
|
||||||
this.attachmentsButton.setAttribute("aria-checked", `${isAttachments}`);
|
this.attachmentsButton.setAttribute("aria-checked", isAttachments);
|
||||||
this.layersButton.setAttribute("aria-checked", `${isLayers}`);
|
this.layersButton.setAttribute("aria-checked", isLayers);
|
||||||
// ... and for all views.
|
// ... and for all views.
|
||||||
this.thumbnailView.classList.toggle("hidden", !isThumbs);
|
this.thumbnailView.classList.toggle("hidden", !isThumbs);
|
||||||
this.outlineView.classList.toggle("hidden", !isOutline);
|
this.outlineView.classList.toggle("hidden", !isOutline);
|
||||||
|
@ -230,8 +230,8 @@ class SecondaryToolbar {
|
|||||||
cursorSelectToolButton.classList.toggle("toggled", isSelect);
|
cursorSelectToolButton.classList.toggle("toggled", isSelect);
|
||||||
cursorHandToolButton.classList.toggle("toggled", isHand);
|
cursorHandToolButton.classList.toggle("toggled", isHand);
|
||||||
|
|
||||||
cursorSelectToolButton.setAttribute("aria-checked", `${isSelect}`);
|
cursorSelectToolButton.setAttribute("aria-checked", isSelect);
|
||||||
cursorHandToolButton.setAttribute("aria-checked", `${isHand}`);
|
cursorHandToolButton.setAttribute("aria-checked", isHand);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,10 +255,10 @@ class SecondaryToolbar {
|
|||||||
scrollHorizontalButton.classList.toggle("toggled", isHorizontal);
|
scrollHorizontalButton.classList.toggle("toggled", isHorizontal);
|
||||||
scrollWrappedButton.classList.toggle("toggled", isWrapped);
|
scrollWrappedButton.classList.toggle("toggled", isWrapped);
|
||||||
|
|
||||||
scrollPageButton.setAttribute("aria-checked", `${isPage}`);
|
scrollPageButton.setAttribute("aria-checked", isPage);
|
||||||
scrollVerticalButton.setAttribute("aria-checked", `${isVertical}`);
|
scrollVerticalButton.setAttribute("aria-checked", isVertical);
|
||||||
scrollHorizontalButton.setAttribute("aria-checked", `${isHorizontal}`);
|
scrollHorizontalButton.setAttribute("aria-checked", isHorizontal);
|
||||||
scrollWrappedButton.setAttribute("aria-checked", `${isWrapped}`);
|
scrollWrappedButton.setAttribute("aria-checked", isWrapped);
|
||||||
|
|
||||||
// Permanently *disable* the Scroll buttons when PAGE-scrolling is being
|
// Permanently *disable* the Scroll buttons when PAGE-scrolling is being
|
||||||
// enforced for *very* long/large documents; please see the `BaseViewer`.
|
// enforced for *very* long/large documents; please see the `BaseViewer`.
|
||||||
@ -298,9 +298,9 @@ class SecondaryToolbar {
|
|||||||
spreadOddButton.classList.toggle("toggled", isOdd);
|
spreadOddButton.classList.toggle("toggled", isOdd);
|
||||||
spreadEvenButton.classList.toggle("toggled", isEven);
|
spreadEvenButton.classList.toggle("toggled", isEven);
|
||||||
|
|
||||||
spreadNoneButton.setAttribute("aria-checked", `${isNone}`);
|
spreadNoneButton.setAttribute("aria-checked", isNone);
|
||||||
spreadOddButton.setAttribute("aria-checked", `${isOdd}`);
|
spreadOddButton.setAttribute("aria-checked", isOdd);
|
||||||
spreadEvenButton.setAttribute("aria-checked", `${isEven}`);
|
spreadEvenButton.setAttribute("aria-checked", isEven);
|
||||||
}
|
}
|
||||||
this.eventBus._on("spreadmodechanged", spreadModeChanged);
|
this.eventBus._on("spreadmodechanged", spreadModeChanged);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user