mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Update the "aria-label" of the page when a pageLabel
exists
Looking at the `PDFThumbnailView.setPageLabel` method you'll see that we update e.g. the "aria-label" of the thumbnail-image for documents that contain (valid) pageLabels. This isn't done in `PDFPageView`, which seems inconsistent, hence this patch.
This commit is contained in:
parent
8376b3fb05
commit
04696080f8
1 changed files with 5 additions and 0 deletions
|
@ -1042,6 +1042,11 @@ class PDFPageView {
|
|||
setPageLabel(label) {
|
||||
this.pageLabel = typeof label === "string" ? label : null;
|
||||
|
||||
this.div.setAttribute(
|
||||
"data-l10n-args",
|
||||
JSON.stringify({ page: this.pageLabel ?? this.id })
|
||||
);
|
||||
|
||||
if (this.pageLabel !== null) {
|
||||
this.div.setAttribute("data-page-label", this.pageLabel);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue