diff --git a/CHANGELOG.md b/CHANGELOG.md index 561f91e..7b7da89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# Exoskeleton 0.5.1 (3 November 2013) +* Added support for `contentType` option in `utils.ajax` + # Exoskeleton 0.5.0 (2 November 2013) * Fixed behaviour in node.js environment. * `Backbone.Deferred` now must return actual `Deferred` diff --git a/bower.json b/bower.json index 8b09ef2..358f294 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "exoskeleton", "main": "exoskeleton.js", - "version": "0.5.0", + "version": "0.5.1", "homepage": "https://github.com/paulmillr/exoskeleton", "author": "Paul Miller (http://paulmillr.com)", "description": "Faster and leaner Backbone for your HTML5 apps.", diff --git a/component.json b/component.json index 9686dd8..e946b44 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "name": "exoskeleton", "repo": "paulmillr/exoskeleton", "description": "Faster and leaner Backbone for your HTML5 apps.", - "version": "0.5.0", + "version": "0.5.1", "keywords": [ "Backbone", "Exoskeleton", diff --git a/exoskeleton.js b/exoskeleton.js index ec1a5ed..ebfff8e 100644 --- a/exoskeleton.js +++ b/exoskeleton.js @@ -1,5 +1,5 @@ /*! - * Exoskeleton.js 0.5.0 + * Exoskeleton.js 0.5.1 * (c) 2013 Paul Miller * Based on Backbone.js * (c) 2010-2013 Jeremy Ashkenas, DocumentCloud @@ -369,6 +369,10 @@ utils.ajax = (function() { var xhr = new XMLHttpRequest(); var deferred = Backbone.Deferred && Backbone.Deferred(); + if (options.contentType) { + if (options.headers == null) options.headers = {}; + options.headers['Content-Type'] = options.contentType; + } if (options.credentials) options.withCredentials = true; xhr.addEventListener('readystatechange', end(xhr, options, deferred)); xhr.open(options.type, options.url, true); @@ -434,7 +438,7 @@ var Events = Backbone.Events = { if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; if (!name && !callback && !context) { - delete this._events; + this._events = undefined; return this; } diff --git a/lib/header.js b/lib/header.js index 9aa648e..b2c7495 100644 --- a/lib/header.js +++ b/lib/header.js @@ -1,5 +1,5 @@ /*! - * Exoskeleton.js 0.5.0 + * Exoskeleton.js 0.5.1 * (c) 2013 Paul Miller * Based on Backbone.js * (c) 2010-2013 Jeremy Ashkenas, DocumentCloud diff --git a/package.json b/package.json index 5be5212..6c781ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "exoskeleton", - "version": "0.5.0", + "version": "0.5.1", "description": "Faster and leaner Backbone for your HTML5 apps.", "main": "exoskeleton.js", "directories": {