[Pkg-javascript-commits] [backbone] 125/211: Adding XHR object to Collection.create (which comes from Model.save).

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:00:12 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.5.0
in repository backbone.

commit 577758af89dc4a86b4c9f391f7d71416054c5923
Author: Samuel Clay <samuel at ofbrooklyn.com>
Date:   Fri Apr 22 11:41:30 2011 -0400

    Adding XHR object to Collection.create (which comes from Model.save).
---
 backbone.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/backbone.js b/backbone.js
index 55b4baf..2694ed3 100644
--- a/backbone.js
+++ b/backbone.js
@@ -274,7 +274,7 @@
       options || (options = {});
       var model = this;
       var success = options.success;
-      options.success = function(resp, _, xhr) {
+      options.success = function(resp, status, xhr) {
         if (!model.set(model.parse(resp, xhr), options)) return false;
         if (success) success(model, resp);
       };
@@ -292,7 +292,7 @@
       var success = options.success;
       options.success = function(resp, status, xhr) {
         if (!model.set(model.parse(resp, xhr), options)) return false;
-        if (success) success(model, resp, request);
+        if (success) success(model, resp, xhr);
       };
       options.error = wrapError(options.error, model, options);
       var method = this.isNew() ? 'create' : 'update';
@@ -535,9 +535,9 @@
         model.collection = coll;
       }
       var success = options.success;
-      options.success = function(nextModel, resp) {
+      options.success = function(nextModel, resp, xhr) {
         coll.add(nextModel);
-        if (success) success(nextModel, resp);
+        if (success) success(nextModel, resp, xhr);
       };
       model.save(null, options);
       return model;

-- 
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