[backend,refactor][xs]: move Backbone.sync override into recline.Model from recline.Backend.base.
This commit is contained in:
parent
fc22e86509
commit
9518d2483d
@ -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.
|
||||
|
||||
@ -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));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user