[Pkg-javascript-commits] [pdf.js] 158/174: Dispatch the `pagerendered` event when zooming is only done with CSS (issue 6463)

David Prévot taffit at moszumanska.debian.org
Thu Nov 19 18:45:40 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 2646f27434a622e11048932841a433a20aeead84
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Thu Nov 12 16:17:26 2015 +0100

    Dispatch the `pagerendered` event when zooming is only done with CSS (issue 6463)
    
    In my opinion, this event shouldn't be dispatched in `PDFPageView.cssTransform`, since that would cause *two* events to be fired when "normal" zooming is used (once in `PDFPageView.cssTransform`, and once in `PDFPageView.draw`).
    
    Fixes 6463.
---
 web/pdf_page_view.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/web/pdf_page_view.js b/web/pdf_page_view.js
index 598c3d9..f882311 100644
--- a/web/pdf_page_view.js
+++ b/web/pdf_page_view.js
@@ -181,6 +181,14 @@ var PDFPageView = (function PDFPageViewClosure() {
         if (PDFJS.useOnlyCssZoom ||
             (this.hasRestrictedScaling && isScalingRestricted)) {
           this.cssTransform(this.canvas, true);
+
+          var event = document.createEvent('CustomEvent');
+          event.initCustomEvent('pagerendered', true, true, {
+            pageNumber: this.id,
+            cssTransform: true,
+          });
+          this.div.dispatchEvent(event);
+
           return;
         }
         if (!this.zoomLayer) {
@@ -421,7 +429,8 @@ var PDFPageView = (function PDFPageViewClosure() {
         }
         var event = document.createEvent('CustomEvent');
         event.initCustomEvent('pagerendered', true, true, {
-          pageNumber: self.id
+          pageNumber: self.id,
+          cssTransform: false,
         });
         div.dispatchEvent(event);
 //#if GENERIC

-- 
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