Permalink
Browse files

[build][s]: usual build.

  • Loading branch information...
1 parent a58f5e5 commit 8fb4b278c3a6cb5d9bab5b3e2c6e467389a741db @rufuspollock rufuspollock committed Jul 5, 2012
View
@@ -6,7 +6,9 @@ this.recline.Model = this.recline.Model || {};
// ## <a id="dataset">Dataset</a>
my.Dataset = Backbone.Model.extend({
- __type__: 'Dataset',
+ constructor: function Dataset() {
+ Backbone.Model.prototype.constructor.apply(this, arguments);
+ },
// ### initialize
initialize: function() {
@@ -20,7 +22,7 @@ my.Dataset = Backbone.Model.extend({
}
}
this.fields = new my.FieldList();
- this.currentRecords = new my.RecordList();
+ this.records = new my.RecordList();
this._changes = {
deletes: [],
updates: [],
@@ -170,7 +172,7 @@ my.Dataset = Backbone.Model.extend({
// It will query based on current query state (given by this.queryState)
// updated by queryObj (if provided).
//
- // Resulting RecordList are used to reset this.currentRecords and are
+ // Resulting RecordList are used to reset this.records and are
// also returned.
query: function(queryObj) {
var self = this;
@@ -186,7 +188,7 @@ my.Dataset = Backbone.Model.extend({
.done(function(queryResult) {
self._handleQueryResult(queryResult);
self.trigger('query:done');
- dfd.resolve(self.currentRecords);
+ dfd.resolve(self.records);
})
.fail(function(arguments) {
self.trigger('query:fail', arguments);
@@ -208,7 +210,7 @@ my.Dataset = Backbone.Model.extend({
});
return _doc;
});
- self.currentRecords.reset(docs);
+ self.records.reset(docs);
if (queryResult.facets) {
var facets = _.map(queryResult.facets, function(facetResult, facetId) {
facetResult.id = facetId;
@@ -331,7 +333,10 @@ my.Dataset.restore = function(state) {
//
// A single entry or row in the dataset
my.Record = Backbone.Model.extend({
- __type__: 'Record',
+ constructor: function Record() {
+ Backbone.Model.prototype.constructor.apply(this, arguments);
+ },
+
initialize: function() {
_.bindAll(this, 'getFieldValue');
},
@@ -369,14 +374,21 @@ my.Record = Backbone.Model.extend({
destroy: function() { this.trigger('destroy', this); }
});
+
// ## A Backbone collection of Records
my.RecordList = Backbone.Collection.extend({
- __type__: 'RecordList',
+ constructor: function RecordList() {
+ Backbone.Collection.prototype.constructor.apply(this, arguments);
+ },
model: my.Record
});
+
// ## <a id="field">A Field (aka Column) on a Dataset</a>
my.Field = Backbone.Model.extend({
+ constructor: function Field() {
+ Backbone.Model.prototype.constructor.apply(this, arguments);
+ },
// ### defaults - define default values
defaults: {
label: null,
@@ -445,11 +457,17 @@ my.Field = Backbone.Model.extend({
});
my.FieldList = Backbone.Collection.extend({
+ constructor: function FieldList() {
+ Backbone.Collection.prototype.constructor.apply(this, arguments);
+ },
model: my.Field
});
// ## <a id="query">Query</a>
my.Query = Backbone.Model.extend({
+ constructor: function Query() {
+ Backbone.Model.prototype.constructor.apply(this, arguments);
+ },
defaults: function() {
return {
size: 100,
@@ -534,6 +552,9 @@ my.Query = Backbone.Model.extend({
// ## <a id="facet">A Facet (Result)</a>
my.Facet = Backbone.Model.extend({
+ constructor: function Facet() {
+ Backbone.Model.prototype.constructor.apply(this, arguments);
+ },
defaults: function() {
return {
_type: 'terms',
@@ -547,6 +568,9 @@ my.Facet = Backbone.Model.extend({
// ## A Collection/List of Facets
my.FacetList = Backbone.Collection.extend({
+ constructor: function FacetList() {
+ Backbone.Collection.prototype.constructor.apply(this, arguments);
+ },
model: my.Facet
});
Oops, something went wrong.

0 comments on commit 8fb4b27

Please sign in to comment.