You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/07/23 01:51:06 UTC

git commit: CB-4263 set ready state to done before onload

Repository: cordova-plugin-file
Updated Branches:
  refs/heads/master 56976ae25 -> 28662835e


CB-4263 set ready state to done before onload


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/28662835
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/28662835
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/28662835

Branch: refs/heads/master
Commit: 28662835e951f678a045471f9fffe56b6398de62
Parents: 56976ae
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Jul 22 16:50:58 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Jul 22 16:50:58 2014 -0700

----------------------------------------------------------------------
 www/FileReader.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/28662835/www/FileReader.js
----------------------------------------------------------------------
diff --git a/www/FileReader.js b/www/FileReader.js
index a9bff52..21ad29a 100644
--- a/www/FileReader.js
+++ b/www/FileReader.js
@@ -144,6 +144,9 @@ FileReader.prototype.readAsText = function(file, encoding) {
                 return;
             }
 
+            // DONE state
+            me._readyState = FileReader.DONE;
+
             // Save result
             me._result = r;
 
@@ -152,9 +155,6 @@ FileReader.prototype.readAsText = function(file, encoding) {
                 me.onload(new ProgressEvent("load", {target:me}));
             }
 
-            // DONE state
-            me._readyState = FileReader.DONE;
-
             // If onloadend callback
             if (typeof me.onloadend === "function") {
                 me.onloadend(new ProgressEvent("loadend", {target:me}));