Merge pull request #5622 from Snuffleupagus/move-pagerendered-event
Move the |pagerendered| event to pdf_page_view.js
This commit is contained in:
commit
3a540ca120
@ -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);
|
||||
|
@ -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);
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user