[Pkg-javascript-commits] [pdf.js] 119/141: Changes 'documentload' event behavior.

David Prévot taffit at moszumanska.debian.org
Sat Apr 19 22:40:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 1fd43a87db911796cce5928700257971cb6b24f1
Author: Yury Delendik <ydelendik at mozilla.com>
Date:   Sun Apr 13 21:07:36 2014 -0500

    Changes 'documentload' event behavior.
---
 web/viewer.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/web/viewer.js b/web/viewer.js
index cf03904..9ecfc0d 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -913,7 +913,7 @@ var PDFView = {
 
     DocumentProperties.resolveDataAvailable();
 
-    pdfDocument.getDownloadInfo().then(function() {
+    var downloadedPromise = pdfDocument.getDownloadInfo().then(function() {
       self.downloadComplete = true;
       PDFView.loadingBar.hide();
       var outerContainer = document.getElementById('outerContainer');
@@ -988,9 +988,11 @@ var PDFView = {
         }
       });
 
-      var event = document.createEvent('CustomEvent');
-      event.initCustomEvent('documentload', true, true, {});
-      window.dispatchEvent(event);
+      downloadedPromise.then(function () {
+        var event = document.createEvent('CustomEvent');
+        event.initCustomEvent('documentload', true, true, {});
+        window.dispatchEvent(event);
+      });
 
       PDFView.loadingBar.setWidth(container);
 

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