[backend,refactor][xs]: move Backbone.sync override into recline.Model from recline.Backend.base.

This commit is contained in:
Rufus Pollock 2012-05-25 09:01:03 +01:00
parent fc22e86509
commit 9518d2483d
2 changed files with 5 additions and 10 deletions

View File

@ -7,13 +7,6 @@ this.recline = this.recline || {};
this.recline.Backend = this.recline.Backend || {};
(function($, my) {
// ## Backbone.sync
//
// Override Backbone.sync to hand off to sync function in relevant backend
Backbone.sync = function(method, model, options) {
return model.backend.sync(method, model, options);
};
// ## recline.Backend.Base
//
// Base class for backends providing a template and convenience functions.

View File

@ -493,10 +493,12 @@ my.ObjectState = Backbone.Model.extend({
});
// ## Backend registry
// ## Backbone.sync
//
// Backends will register themselves by id into this registry
my.backends = {};
// Override Backbone.sync to hand off to sync function in relevant backend
Backbone.sync = function(method, model, options) {
return model.backend.sync(method, model, options);
};
}(jQuery, this.recline.Model));