mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-04 22:25:50 +02:00
Reduce duplication when updating undoButton/undoCloseButton in PDFThumbnailViewer.prototype.#updateStatus
This commit is contained in:
parent
a0061817e6
commit
f373fbfa5b
@ -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