cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [2/2] git commit: Applied Sergey's changes to WP7 as well
Date Wed, 20 Nov 2013 02:03:03 GMT
Applied Sergey's changes to WP7 as well


Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/0e2d0320
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/0e2d0320
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/0e2d0320

Branch: refs/heads/master
Commit: 0e2d032063a6097b0510032b0d49d77492d2ef45
Parents: 73211a9
Author: purplecabbage <purplecabbage@gmail.com>
Authored: Tue Nov 19 18:01:22 2013 -0800
Committer: purplecabbage <purplecabbage@gmail.com>
Committed: Tue Nov 19 18:01:22 2013 -0800

----------------------------------------------------------------------
 wp7/template/cordovalib/XHRHelper.cs | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/0e2d0320/wp7/template/cordovalib/XHRHelper.cs
----------------------------------------------------------------------
diff --git a/wp7/template/cordovalib/XHRHelper.cs b/wp7/template/cordovalib/XHRHelper.cs
index d9945f3..ae4daf8 100644
--- a/wp7/template/cordovalib/XHRHelper.cs
+++ b/wp7/template/cordovalib/XHRHelper.cs
@@ -124,6 +124,22 @@ namespace WPCordovaClassLib.CordovaLib
                     this.onload && this.onload();
                 }
             },
+            addEventListener: function (type, listener, useCapture){
+                if (this.wrappedXHR) {
+                    this.wrappedXHR.addEventListener(type, listener, useCapture);
+                } else {
+                    this['on' + type] = listener;
+                }
+            },
+            removeEventListener: function (type, listener, useCapture){
+                if (this.wrappedXHR) {
+                    this.wrappedXHR.removeEventListener(type, listener, useCapture);
+                } else {
+                    if (this['on' + type] == listener) { // if listener is currently used
+                        delete this['on' + type];
+                    }
+                }
+            },
             setRequestHeader: function(header, value) {
                 if (this.wrappedXHR) {
                     this.wrappedXHR.setRequestHeader(header, value);


Mime
View raw message