Merge pull request #17360 from Snuffleupagus/issue-17347

Remove the "transitionend" event listener from the default viewer (issue 17347)
This commit is contained in:
Jonas Jenwald 2023-12-01 10:22:42 +01:00 committed by GitHub
commit 096426f073
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 13 deletions

View File

@ -2209,10 +2209,10 @@ describe("annotation", function () {
});
it("should compress and save text", async function () {
if (isNodeJS && getNodeVersion().major === 21) {
if (isNodeJS && getNodeVersion().major >= 20) {
pending(
"CompressionStream behaves differently in Node.js 21, " +
"compared to Firefox, Chrome, and Node.js 18/20."
"CompressionStream behaves differently in Node.js >= 20, " +
"compared to Firefox, Chrome, and Node.js 18."
);
}
const textWidgetRef = Ref.get(123, 0);

View File

@ -689,16 +689,6 @@ const PDFViewerApplication = {
appConfig.toolbar?.viewFind?.classList.add("hidden");
}
appConfig.mainContainer.addEventListener(
"transitionend",
function (evt) {
if (evt.target === /* mainContainer */ this) {
eventBus.dispatch("resize", { source: this });
}
},
true
);
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
if (file) {
this.open({ url: file });

View File

@ -329,6 +329,8 @@ class PDFSidebar {
this.sidebarContainer.addEventListener("transitionend", evt => {
if (evt.target === this.sidebarContainer) {
this.outerContainer.classList.remove("sidebarMoving");
// Ensure that rendering is triggered after opening/closing the sidebar.
this.eventBus.dispatch("resize", { source: this });
}
});