[Pkg-javascript-commits] [backbone] 24/34: Fixing Collection#create success callback, passing the model parameter through.
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 16:58:54 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.2.0
in repository backbone.
commit 931338ea14ae5e6f87b4e22b545354f19b58bef4
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date: Wed Oct 20 14:57:40 2010 -0400
Fixing Collection#create success callback, passing the model parameter through.
---
backbone.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/backbone.js b/backbone.js
index a2f43f2..cf5b8b2 100644
--- a/backbone.js
+++ b/backbone.js
@@ -417,10 +417,10 @@
create : function(model, options) {
options || (options = {});
if (!(model instanceof Backbone.Model)) model = new this.model(model);
- model.collection = this;
- var success = function(resp) {
- model.collection.add(model);
- if (options.success) options.success(model, resp);
+ var coll = model.collection = this;
+ var success = function(nextModel, resp) {
+ coll.add(nextModel);
+ if (options.success) options.success(nextModel, resp);
};
return model.save(null, {success : success, error : options.error});
},
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list