[Pkg-javascript-commits] [backbone] 10/15: Allowing 'sync' to be overriden on a per-model per-collection basis.

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 16:59:30 UTC 2014


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

js pushed a commit to tag 0.3.2
in repository backbone.

commit a969d670c7e0cff0e8253d45a0d71547837d59cc
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Mon Nov 22 14:51:18 2010 -0500

    Allowing 'sync' to be overriden on a per-model per-collection basis.
---
 backbone.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/backbone.js b/backbone.js
index 561e6bb..f8b9b0f 100644
--- a/backbone.js
+++ b/backbone.js
@@ -234,7 +234,7 @@
         if (options.success) options.success(model, resp);
       };
       var error = options.error && _.bind(options.error, null, model);
-      Backbone.sync('read', this, success, error);
+      (this.sync || Backbone.sync)('read', this, success, error);
       return this;
     },
 
@@ -252,7 +252,7 @@
       };
       var error = options.error && _.bind(options.error, null, model);
       var method = this.isNew() ? 'create' : 'update';
-      Backbone.sync(method, this, success, error);
+      (this.sync || Backbone.sync)(method, this, success, error);
       return this;
     },
 
@@ -266,7 +266,7 @@
         if (options.success) options.success(model, resp);
       };
       var error = options.error && _.bind(options.error, null, model);
-      Backbone.sync('delete', this, success, error);
+      (this.sync || Backbone.sync)('delete', this, success, error);
       return this;
     },
 
@@ -473,7 +473,7 @@
         if (options.success) options.success(collection, resp);
       };
       var error = options.error && _.bind(options.error, null, collection);
-      Backbone.sync('read', this, success, error);
+      (this.sync || Backbone.sync)('read', this, success, error);
       return this;
     },
 

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