mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-05 22:55:49 +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 });
|
this.#toggleBar("undo", l10nId, { count });
|
||||||
|
|
||||||
if (type === "copy") {
|
const isCopy = type === "copy";
|
||||||
this.#undoButton.firstElementChild.setAttribute(
|
this.#undoButton.firstElementChild.setAttribute(
|
||||||
"data-l10n-id",
|
"data-l10n-id",
|
||||||
"pdfjs-views-manager-status-done-button-label"
|
isCopy
|
||||||
);
|
? "pdfjs-views-manager-status-done-button-label"
|
||||||
this.#undoCloseButton.classList.toggle("hidden", true);
|
: "pdfjs-views-manager-status-undo-button-label"
|
||||||
} else {
|
);
|
||||||
this.#undoButton.firstElementChild.setAttribute(
|
this.#undoCloseButton.classList.toggle("hidden", isCopy);
|
||||||
"data-l10n-id",
|
|
||||||
"pdfjs-views-manager-status-undo-button-label"
|
|
||||||
);
|
|
||||||
this.#undoCloseButton.classList.toggle("hidden", false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#moveDraggedContainer(dx, dy) {
|
#moveDraggedContainer(dx, dy) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user