Move the |pagerendered| event to pdf_page_view.js
Also deprecates the |pagerender| event, except for GENERIC builds.
This commit is contained in:
parent
039c7b4085
commit
95dd9ee185
@ -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);
|
||||||
|
@ -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);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user