[Pkg-javascript-commits] [backbone] 60/211: keep custom `sync` methods for a given model/collection scoped to `this`.

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:00:02 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 e398583d3813f7d04fd9c308d4d75b317cf78641
Author: Jed Schmidt <tr at nslator.jp>
Date:   Thu Feb 3 20:25:12 2011 -0800

    keep custom `sync` methods for a given model/collection scoped to `this`.
---
 backbone.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/backbone.js b/backbone.js
index e323ed0..0aab0e8 100644
--- a/backbone.js
+++ b/backbone.js
@@ -258,7 +258,7 @@
         if (success) success(model, resp);
       };
       options.error = wrapError(options.error, model, options);
-      (this.sync || Backbone.sync)('read', this, options);
+      (this.sync || Backbone.sync).call(this, 'read', this, options);
       return this;
     },
 
@@ -276,7 +276,7 @@
       };
       options.error = wrapError(options.error, model, options);
       var method = this.isNew() ? 'create' : 'update';
-      (this.sync || Backbone.sync)(method, this, options);
+      (this.sync || Backbone.sync).call(this, method, this, options);
       return this;
     },
 
@@ -291,7 +291,7 @@
         if (success) success(model, resp);
       };
       options.error = wrapError(options.error, model, options);
-      (this.sync || Backbone.sync)('delete', this, options);
+      (this.sync || Backbone.sync).call(this, 'delete', this, options);
       return this;
     },
 
@@ -501,7 +501,7 @@
         if (success) success(collection, resp);
       };
       options.error = wrapError(options.error, collection, options);
-      (this.sync || Backbone.sync)('read', this, options);
+      (this.sync || Backbone.sync).call(this, 'read', this, options);
       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