aboutsummaryrefslogtreecommitdiffstats
path: root/caldav.js
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2013-01-07 08:31:48 +0100
committerJames Lal <james@lightsofapollo.com>2013-01-07 08:38:32 +0100
commit9b2838f364952fce110ab1d754c6b27b2ea7ee4a (patch)
tree1db03817dd0de4b411654eeb18c4bf2760588ce7 /caldav.js
parentd64a1c54d6098596af1ed68272c78975ec56d0b7 (diff)
downloadjsCalDAV-9b2838f364952fce110ab1d754c6b27b2ea7ee4a.tar.gz
use progress events
Diffstat (limited to 'caldav.js')
-rw-r--r--caldav.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/caldav.js b/caldav.js
index 75b9cdd..32cfb34 100644
--- a/caldav.js
+++ b/caldav.js
@@ -1425,6 +1425,10 @@ function write (chunk) {
return this._parse.write(chunk);
},
+ close: function() {
+ this._parse.close();
+ },
+
get closed() {
return this._parse.closed;
},
@@ -2691,12 +2695,16 @@ function write (chunk) {
var req = this.xhr;
req.data = this._createPayload();
+ req.ondata = function xhrOnData(chunk) {
+ self.sax.write(chunk);
+ };
+
// in the future we may stream data somehow
req.send(function xhrResult() {
var xhr = req.xhr;
if (xhr.status > 199 && xhr.status < 300) {
// success
- self.sax.write(xhr.responseText).close();
+ self.sax.close();
self._processResult(req, callback);
} else {
// fail