[backend,refactor][xs]: move Backbone.sync override into recline.Model from recline.Backend.base.
This commit is contained in:
@@ -7,13 +7,6 @@ this.recline = this.recline || {};
|
|||||||
this.recline.Backend = this.recline.Backend || {};
|
this.recline.Backend = this.recline.Backend || {};
|
||||||
|
|
||||||
(function($, my) {
|
(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
|
// ## recline.Backend.Base
|
||||||
//
|
//
|
||||||
// Base class for backends providing a template and convenience functions.
|
// 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
|
// Override Backbone.sync to hand off to sync function in relevant backend
|
||||||
my.backends = {};
|
Backbone.sync = function(method, model, options) {
|
||||||
|
return model.backend.sync(method, model, options);
|
||||||
|
};
|
||||||
|
|
||||||
}(jQuery, this.recline.Model));
|
}(jQuery, this.recline.Model));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user