mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-05 06:35:48 +02:00
Merge pull request #21531 from Snuffleupagus/PDFThumbnailViewer-#updateStatus-isCopy
Reduce duplication when updating undoButton/undoCloseButton in `PDFThumbnailViewer.prototype.#updateStatus`
This commit is contained in:
commit
ab90210aa4
@ -1215,19 +1215,14 @@ class PDFThumbnailViewer {
|
||||
}
|
||||
this.#toggleBar("undo", l10nId, { count });
|
||||
|
||||
if (type === "copy") {
|
||||
this.#undoButton.firstElementChild.setAttribute(
|
||||
"data-l10n-id",
|
||||
"pdfjs-views-manager-status-done-button-label"
|
||||
);
|
||||
this.#undoCloseButton.classList.toggle("hidden", true);
|
||||
} else {
|
||||
this.#undoButton.firstElementChild.setAttribute(
|
||||
"data-l10n-id",
|
||||
"pdfjs-views-manager-status-undo-button-label"
|
||||
);
|
||||
this.#undoCloseButton.classList.toggle("hidden", false);
|
||||
}
|
||||
const isCopy = type === "copy";
|
||||
this.#undoButton.firstElementChild.setAttribute(
|
||||
"data-l10n-id",
|
||||
isCopy
|
||||
? "pdfjs-views-manager-status-done-button-label"
|
||||
: "pdfjs-views-manager-status-undo-button-label"
|
||||
);
|
||||
this.#undoCloseButton.classList.toggle("hidden", isCopy);
|
||||
}
|
||||
|
||||
#moveDraggedContainer(dx, dy) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user