Remove the "transitionend" event listener from the default viewer (issue 17347)
Given that this event listener is only used to trigger rendering after the sidebar has been opened/closed, we can utilize the existing one in the `PDFSidebar` class for this purpose instead. That one is registered on the sidebar DOM-element, and is needed to remove a CSS-class indicating that the sidebar is moving.
This commit is contained in:
parent
9ac1ac6ed3
commit
412502370d
10
web/app.js
10
web/app.js
@ -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 });
|
||||
|
@ -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 });
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user