Skip to content

Commit

Permalink
switched a couple success handlers to jquery deferreds
Browse files Browse the repository at this point in the history
  • Loading branch information
dgeb committed Jan 27, 2012
1 parent e8d8d4c commit 325269d
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions app/assets/javascripts/vendor/ember-rest.js
Expand Up @@ -121,12 +121,11 @@ Ember.Resource = Ember.Object.extend({
url: this._url(),
data: this.serialize(),
dataType: 'json',
type: (isNew ? 'POST' : 'PUT'),
success: function(json) {
// Update properties
if (json)
self.deserialize(json);
}
type: (isNew ? 'POST' : 'PUT')
}).done( function(json) {
// Update properties
if (json)
self.deserialize(json);
});
},

Expand Down Expand Up @@ -199,11 +198,10 @@ Ember.ResourceController = Ember.ArrayController.extend({
return jQuery.ajax({
url: this._url(),
dataType: 'json',
type: 'GET',
success: function(json) {
self.set("content", []);
self.loadAll(json);
}
type: 'GET'
}).done( function(json) {
self.set("content", []);
self.loadAll(json);
});
},

Expand Down

0 comments on commit 325269d

Please sign in to comment.