[#128,backend][xs]: minor tweaks to memory backend to follow style in ES - all tests passing again (though stuff still broken in app!).

This commit is contained in:
Rufus Pollock 2012-05-26 16:07:05 +01:00
parent fae1496eb2
commit ad7fc1a029
2 changed files with 7 additions and 7 deletions

View File

@ -16,8 +16,8 @@ this.recline.Backend.Memory = this.recline.Backend.Memory || {};
// If not defined (or id not provided) id will be autogenerated.
my.createDataset = function(data, fields, metadata) {
var wrapper = new my.DataWrapper(data, fields);
var syncer = new my.BackboneSyncer();
var dataset = new recline.Model.Dataset(metadata, syncer);
var backend = new my.Backbone();
var dataset = new recline.Model.Dataset(metadata, backend);
dataset._dataCache = wrapper;
dataset.fetch();
dataset.query();
@ -157,11 +157,11 @@ this.recline.Backend.Memory = this.recline.Backend.Memory || {};
};
// ## BackboneSyncer
// ## Backbone
//
// Provide a Backbone Sync interface to a DataWrapper data backend attached
// to a Dataset object
my.BackboneSyncer = function() {
// Backbone connector for memory store attached to a Dataset object
my.Backbone = function() {
this.__type__ = 'memory';
this.sync = function(method, model, options) {
var self = this;
var dfd = $.Deferred();

View File

@ -362,7 +362,7 @@ my.DataExplorer = Backbone.View.extend({
var stateData = _.extend({
query: query,
'view-graph': graphState,
backend: this.model.backendType,
backend: this.model.backend.__type__,
dataset: this.model.toJSON(),
currentView: null,
readOnly: false