Skip to content

Commit

Permalink
Invoke the "download" event handler correctly (PR 18527 follow-up)
Browse files Browse the repository at this point in the history
Since the `PDFViewerApplication.downloadOrSave` method accepts an optional argument we cannot use `bind` but instead need to invoke it explicitly when handling the "download" event; currently this leads to failing tests in mozilla-central.
  • Loading branch information
Snuffleupagus committed Aug 2, 2024
1 parent a372bf8 commit 332cab4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,7 @@ const PDFViewerApplication = {
{ signal }
);
eventBus._on("print", this.triggerPrinting.bind(this), { signal });
eventBus._on("download", this.downloadOrSave.bind(this), { signal });
eventBus._on("download", () => this.downloadOrSave(), { signal });
eventBus._on("firstpage", () => (this.page = 1), { signal });
eventBus._on("lastpage", () => (this.page = this.pagesCount), { signal });
eventBus._on("nextpage", () => pdfViewer.nextPage(), { signal });
Expand Down

0 comments on commit 332cab4

Please sign in to comment.