From 7941b31b61126612e8c8cdaf1233302000de4771 Mon Sep 17 00:00:00 2001 From: Jacob MacDonald Date: Wed, 19 Nov 2014 10:00:14 -0800 Subject: [PATCH] add abort to core-ajax --- core-ajax.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core-ajax.html b/core-ajax.html index 6287ff0..07277a7 100644 --- a/core-ajax.html +++ b/core-ajax.html @@ -398,6 +398,20 @@ } } return this.activeRequest; + }, + + /** + * Aborts the current active request if there is one and resets internal + * state appropriately. + * + * @method abort + */ + abort: function() { + if (!this.activeRequest) return; + this.activeRequest.abort(); + this.activeRequest = null; + this.progress = {}; + this.loading = false; } });