Merge pull request #5622 from Snuffleupagus/move-pagerendered-event

Move the |pagerendered| event to pdf_page_view.js
This commit is contained in:
Yury Delendik 2015-01-07 14:16:51 -06:00
commit 3a540ca120
2 changed files with 11 additions and 8 deletions

View File

@ -413,12 +413,20 @@ var PDFPageView = (function PDFPageViewClosure() {
if (self.onAfterDraw) {
self.onAfterDraw();
}
var event = document.createEvent('CustomEvent');
event.initCustomEvent('pagerender', true, true, {
pageNumber: pdfPage.pageNumber
event.initCustomEvent('pagerendered', true, true, {
pageNumber: self.id
});
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) {
resolveRenderPromise(undefined);

View File

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