[Pkg-javascript-commits] [pdf.js] 25/116: Move the |pagerendered| event to pdf_page_view.js
David Prévot
taffit at moszumanska.debian.org
Fri Mar 6 16:19:57 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 95dd9ee185d52f543598cf1b731834ec74ff0626
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Tue Jan 6 17:50:49 2015 +0100
Move the |pagerendered| event to pdf_page_view.js
Also deprecates the |pagerender| event, except for GENERIC builds.
---
web/pdf_page_view.js | 14 +++++++++++---
web/pdf_viewer.js | 5 -----
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/web/pdf_page_view.js b/web/pdf_page_view.js
index cb0725a..047b202 100644
--- a/web/pdf_page_view.js
+++ b/web/pdf_page_view.js
@@ -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);
diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js
index e68130c..6e2acd3 100644
--- a/web/pdf_viewer.js
+++ b/web/pdf_viewer.js
@@ -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);
};
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list