mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Tweak the matchCount
l10n-args handling slightly (PR 17146 follow-up)
Given that providing unused parameters in the l10n-args shouldn't be a problem, let's simplify the relevant JavaScript code a tiny bit.
This commit is contained in:
parent
e2af77fd6c
commit
bcb01e5e2b
1 changed files with 3 additions and 4 deletions
|
@ -144,16 +144,15 @@ class PDFFindBar {
|
|||
const { findResultsCount } = this;
|
||||
|
||||
if (total > 0) {
|
||||
const limit = MATCHES_COUNT_LIMIT,
|
||||
isLimited = total > limit;
|
||||
const limit = MATCHES_COUNT_LIMIT;
|
||||
|
||||
findResultsCount.setAttribute(
|
||||
"data-l10n-id",
|
||||
`pdfjs-find-match-count${isLimited ? "-limit" : ""}`
|
||||
`pdfjs-find-match-count${total > limit ? "-limit" : ""}`
|
||||
);
|
||||
findResultsCount.setAttribute(
|
||||
"data-l10n-args",
|
||||
JSON.stringify(isLimited ? { limit } : { current, total })
|
||||
JSON.stringify({ limit, current, total })
|
||||
);
|
||||
} else {
|
||||
findResultsCount.removeAttribute("data-l10n-id");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue