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:
Jonas Jenwald 2015-11-12 16:17:26 +01:00
parent 3a23367f04
commit 2646f27434

View File

@ -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