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
@ -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…
Reference in New Issue
Block a user