diff options
author | gaye <gaye@mozilla.com> | 2013-04-16 15:50:24 -0700 |
---|---|---|
committer | gaye <gaye@mozilla.com> | 2013-04-18 10:46:25 -0700 |
commit | 5e788a0315b937ebfaea47ee15103b093bd4edb3 (patch) | |
tree | 9024ea21340ac246de43d7c467a4886dcd5d8382 /lib/caldav/request/calendar_home.js | |
parent | c439df4388cc4bb5c1777c4dbdc5b164d5192d7f (diff) | |
download | jsCalDAV-5e788a0315b937ebfaea47ee15103b093bd4edb3.tar.gz |
Add an abort routine to Caldav.Xhr
Diffstat (limited to 'lib/caldav/request/calendar_home.js')
-rw-r--r-- | lib/caldav/request/calendar_home.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/caldav/request/calendar_home.js b/lib/caldav/request/calendar_home.js index 24b27bc..a1f8ca6 100644 --- a/lib/caldav/request/calendar_home.js +++ b/lib/caldav/request/calendar_home.js @@ -52,6 +52,10 @@ Propfind: ns.require('request/propfind'), + /** + * @return {Caldav.Xhr} The underlying xhr request so that the caller + * has a chance to abort the request. + */ _findPrincipal: function(url, callback) { var find = new this.Propfind(this.connection, { url: url @@ -60,7 +64,7 @@ find.prop('current-user-principal'); find.prop('principal-URL'); - find.send(function(err, data) { + return find.send(function(err, data) { var principal; if (err) { @@ -81,7 +85,6 @@ } else { callback(new Errors.CaldavHttpError(404)); } - }); }, @@ -93,7 +96,7 @@ find.prop(['caldav', 'calendar-home-set']); - find.send(function(err, data) { + return find.send(function(err, data) { if (err) { callback(err); return; @@ -112,10 +115,12 @@ * * @param {Function} callback node style where second argument * are the details of the home calendar. + * @return {Caldav.Xhr} The underlying xhr request so that the caller + * has a chance to abort the request. */ send: function(callback) { var self = this; - self._findPrincipal(self.url, function(err, url) { + return self._findPrincipal(self.url, function(err, url) { if (!url) { callback(err); |