[build][xs]: build latest.
This commit is contained in:
19
dist/recline.dataset.js
vendored
19
dist/recline.dataset.js
vendored
@@ -499,11 +499,7 @@ my.Query = Backbone.Model.extend({
|
|||||||
var ourfilter = JSON.parse(JSON.stringify(filter));
|
var ourfilter = JSON.parse(JSON.stringify(filter));
|
||||||
// not fully specified so use template and over-write
|
// not fully specified so use template and over-write
|
||||||
if (_.keys(filter).length <= 3) {
|
if (_.keys(filter).length <= 3) {
|
||||||
ourfilter = _.extend(
|
ourfilter = _.defaults(ourfilter, this._filterTemplates[filter.type]);
|
||||||
// crude deep copy
|
|
||||||
JSON.parse(JSON.stringify(this._filterTemplates[filter.type])),
|
|
||||||
ourfilter
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
var filters = this.get('filters');
|
var filters = this.get('filters');
|
||||||
filters.push(ourfilter);
|
filters.push(ourfilter);
|
||||||
@@ -820,12 +816,15 @@ this.recline.Backend.Memory = this.recline.Backend.Memory || {};
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.transform = function(editFunc) {
|
this.transform = function(editFunc) {
|
||||||
var toUpdate = recline.Data.Transform.mapDocs(this.data, editFunc);
|
var dfd = $.Deferred();
|
||||||
// TODO: very inefficient -- could probably just walk the documents and updates in tandem and update
|
// TODO: should we clone before mapping? Do not see the point atm.
|
||||||
_.each(toUpdate.updates, function(record, idx) {
|
self.data = _.map(self.data, editFunc);
|
||||||
self.data[idx] = record;
|
// now deal with deletes (i.e. nulls)
|
||||||
|
self.data = _.filter(self.data, function(record) {
|
||||||
|
return record != null;
|
||||||
});
|
});
|
||||||
return this.save(toUpdate);
|
dfd.resolve();
|
||||||
|
return dfd.promise();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
19
dist/recline.js
vendored
19
dist/recline.js
vendored
@@ -1171,12 +1171,15 @@ this.recline.Backend.Memory = this.recline.Backend.Memory || {};
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.transform = function(editFunc) {
|
this.transform = function(editFunc) {
|
||||||
var toUpdate = recline.Data.Transform.mapDocs(this.data, editFunc);
|
var dfd = $.Deferred();
|
||||||
// TODO: very inefficient -- could probably just walk the documents and updates in tandem and update
|
// TODO: should we clone before mapping? Do not see the point atm.
|
||||||
_.each(toUpdate.updates, function(record, idx) {
|
self.data = _.map(self.data, editFunc);
|
||||||
self.data[idx] = record;
|
// now deal with deletes (i.e. nulls)
|
||||||
|
self.data = _.filter(self.data, function(record) {
|
||||||
|
return record != null;
|
||||||
});
|
});
|
||||||
return this.save(toUpdate);
|
dfd.resolve();
|
||||||
|
return dfd.promise();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1880,11 +1883,7 @@ my.Query = Backbone.Model.extend({
|
|||||||
var ourfilter = JSON.parse(JSON.stringify(filter));
|
var ourfilter = JSON.parse(JSON.stringify(filter));
|
||||||
// not fully specified so use template and over-write
|
// not fully specified so use template and over-write
|
||||||
if (_.keys(filter).length <= 3) {
|
if (_.keys(filter).length <= 3) {
|
||||||
ourfilter = _.extend(
|
ourfilter = _.defaults(ourfilter, this._filterTemplates[filter.type]);
|
||||||
// crude deep copy
|
|
||||||
JSON.parse(JSON.stringify(this._filterTemplates[filter.type])),
|
|
||||||
ourfilter
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
var filters = this.get('filters');
|
var filters = this.get('filters');
|
||||||
filters.push(ourfilter);
|
filters.push(ourfilter);
|
||||||
|
|||||||
Reference in New Issue
Block a user