Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: polymer_0.5.4/bower_components/core-ajax/core-ajax.html

Issue 895523005: Added Polymer 0.5.4 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: polymer_0.5.4/bower_components/core-ajax/core-ajax.html
diff --git a/polymer_0.5.0/bower_components/core-ajax/core-ajax.html b/polymer_0.5.4/bower_components/core-ajax/core-ajax.html
similarity index 94%
copy from polymer_0.5.0/bower_components/core-ajax/core-ajax.html
copy to polymer_0.5.4/bower_components/core-ajax/core-ajax.html
index c0ca0adbc25f5919da4c0f25131b4a5e5ed1f01f..7b36af2bb497e935a6f5e99d2eab82ef96d8e822 100644
--- a/polymer_0.5.0/bower_components/core-ajax/core-ajax.html
+++ b/polymer_0.5.4/bower_components/core-ajax/core-ajax.html
@@ -100,7 +100,7 @@ element.
* Parameters to send to the specified URL, as JSON.
*
* @attribute params
- * @type string (JSON)
+ * @type string
* @default ''
*/
params: '',
@@ -347,6 +347,14 @@ element.
}
},
+ getParams: function(params) {
+ params = this.params || params;
+ if (params && typeof(params) == 'string') {
+ params = JSON.parse(params);
+ }
+ return params;
+ },
+
/**
* Performs an Ajax request to the specified URL.
*
@@ -356,10 +364,7 @@ element.
var args = this.xhrArgs || {};
// TODO(sjmiles): we may want XHR to default to POST if body is set
args.body = this.body || args.body;
- args.params = this.params || args.params;
- if (args.params && typeof(args.params) == 'string') {
- args.params = JSON.parse(args.params);
- }
+ args.params = this.getParams(args.params);
args.headers = this.headers || args.headers || {};
if (args.headers && typeof(args.headers) == 'string') {
args.headers = JSON.parse(args.headers);
@@ -403,6 +408,20 @@ element.
}
}
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;
}
});
« no previous file with comments | « polymer_0.5.4/bower_components/core-ajax/bower.json ('k') | polymer_0.5.4/bower_components/core-ajax/core-xhr.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698