Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

browser build

  • Loading branch information...
commit c439df4388cc4bb5c1777c4dbdc5b164d5192d7f 1 parent fbd1d6d
@lightsofapollo lightsofapollo authored
Showing with 9 additions and 7 deletions.
  1. +9 −7 caldav.js
View
16 caldav.js
@@ -2103,21 +2103,23 @@ function write (chunk) {
var last = 0;
if (useMozChunkedText) {
- xhr.onprogress = function onChunkedProgress(event) {
- this.ondata(xhr.responseText);
- }.bind(this);
+ xhr.onprogress = (function onChunkedProgress(event) {
+ if (this.ondata) {
+ this.ondata(xhr.responseText);
+ }
+ }.bind(this));
} else {
- xhr.onprogress = function onProgress(event) {
+ xhr.onprogress = (function onProgress(event) {
var chunk = xhr.responseText.substr(last, event.loaded);
last = event.loaded;
if (this.ondata) {
this.ondata(chunk);
}
- }.bind(this);
+ }.bind(this));
}
}
- xhr.onreadystatechange = function onReadyStateChange() {
+ xhr.onreadystatechange = (function onReadyStateChange() {
var data;
if (xhr.readyState === 4) {
data = xhr.responseText;
@@ -2133,7 +2135,7 @@ function write (chunk) {
this.waiting = false;
callback(null, xhr);
}
- }.bind(this);
+ }.bind(this));
this.waiting = true;
xhr.send(this._seralize());
Please sign in to comment.
Something went wrong with that request. Please try again.