mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Dispatch the pagerendered
event when zooming is only done with CSS (issue 6463)
In my opinion, this event shouldn't be dispatched in `PDFPageView.cssTransform`, since that would cause *two* events to be fired when "normal" zooming is used (once in `PDFPageView.cssTransform`, and once in `PDFPageView.draw`). Fixes 6463.
This commit is contained in:
parent
3a23367f04
commit
2646f27434
1 changed files with 10 additions and 1 deletions
|
@ -181,6 +181,14 @@ var PDFPageView = (function PDFPageViewClosure() {
|
|||
if (PDFJS.useOnlyCssZoom ||
|
||||
(this.hasRestrictedScaling && isScalingRestricted)) {
|
||||
this.cssTransform(this.canvas, true);
|
||||
|
||||
var event = document.createEvent('CustomEvent');
|
||||
event.initCustomEvent('pagerendered', true, true, {
|
||||
pageNumber: this.id,
|
||||
cssTransform: true,
|
||||
});
|
||||
this.div.dispatchEvent(event);
|
||||
|
||||
return;
|
||||
}
|
||||
if (!this.zoomLayer) {
|
||||
|
@ -421,7 +429,8 @@ var PDFPageView = (function PDFPageViewClosure() {
|
|||
}
|
||||
var event = document.createEvent('CustomEvent');
|
||||
event.initCustomEvent('pagerendered', true, true, {
|
||||
pageNumber: self.id
|
||||
pageNumber: self.id,
|
||||
cssTransform: false,
|
||||
});
|
||||
div.dispatchEvent(event);
|
||||
//#if GENERIC
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue