[Pkg-javascript-commits] [pdf.js] 99/141: Adds then method to the RenderTask

David Prévot taffit at moszumanska.debian.org
Sat Apr 19 22:40:34 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 8c0762a32a24666dbcfdc4115c1e927ef02f8a11
Author: Yury Delendik <ydelendik at mozilla.com>
Date:   Fri Apr 11 12:10:42 2014 -0500

    Adds then method to the RenderTask
---
 src/display/api.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/display/api.js b/src/display/api.js
index 7495907..7185cbb 100644
--- a/src/display/api.js
+++ b/src/display/api.js
@@ -1185,6 +1185,18 @@ var RenderTask = (function RenderTaskClosure() {
     cancel: function RenderTask_cancel() {
       this.internalRenderTask.cancel();
       this.promise.reject(new Error('Rendering is cancelled'));
+    },
+
+    /**
+     * Registers callback to indicate the rendering task completion.
+     *
+     * @param {function} onFulfilled The callback for the rendering completion.
+     * @param {function} onRejected The callback for the rendering failure.
+     * @return {Promise} A promise that is resolved after the onFulfilled or
+     *                   onRejected callback.
+     */
+    then: function RenderTask_then(onFulfilled, onRejected) {
+      return this.promise.then(onFulfilled, onRejected);
     }
   };
 

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