Move the |pagerendered| event to pdf_page_view.js

Also deprecates the |pagerender| event, except for GENERIC builds.
This commit is contained in:
Jonas Jenwald 2015-01-06 17:50:49 +01:00
parent 039c7b4085
commit 95dd9ee185
2 changed files with 11 additions and 8 deletions

View File

@ -413,12 +413,20 @@ var PDFPageView = (function PDFPageViewClosure() {
if (self.onAfterDraw) { if (self.onAfterDraw) {
self.onAfterDraw(); self.onAfterDraw();
} }
var event = document.createEvent('CustomEvent'); var event = document.createEvent('CustomEvent');
event.initCustomEvent('pagerender', true, true, { event.initCustomEvent('pagerendered', true, true, {
pageNumber: pdfPage.pageNumber pageNumber: self.id
}); });
div.dispatchEvent(event); div.dispatchEvent(event);
//#if GENERIC
// This custom event is deprecated, and will be removed in the future,
// please use the |pagerendered| event instead.
var deprecatedEvent = document.createEvent('CustomEvent');
deprecatedEvent.initCustomEvent('pagerender', true, true, {
pageNumber: pdfPage.pageNumber
});
div.dispatchEvent(deprecatedEvent);
//#endif
if (!error) { if (!error) {
resolveRenderPromise(undefined); resolveRenderPromise(undefined);

View File

@ -244,11 +244,6 @@ var PDFViewer = (function pdfViewer() {
isOnePageRenderedResolved = true; isOnePageRenderedResolved = true;
resolveOnePageRendered(); resolveOnePageRendered();
} }
var event = document.createEvent('CustomEvent');
event.initCustomEvent('pagerendered', true, true, {
pageNumber: pageView.id
});
self.container.dispatchEvent(event);
}; };
}; };