Fixes a bug in querystate handling. Fixes okfn/dataexplorer#120.
This commit is contained in:
@@ -16,6 +16,7 @@ my.Dataset = Backbone.Model.extend({
|
|||||||
|
|
||||||
// ### initialize
|
// ### initialize
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
|
var self = this;
|
||||||
_.bindAll(this, 'query');
|
_.bindAll(this, 'query');
|
||||||
this.backend = null;
|
this.backend = null;
|
||||||
if (this.get('backend')) {
|
if (this.get('backend')) {
|
||||||
@@ -35,8 +36,9 @@ my.Dataset = Backbone.Model.extend({
|
|||||||
this.facets = new my.FacetList();
|
this.facets = new my.FacetList();
|
||||||
this.recordCount = null;
|
this.recordCount = null;
|
||||||
this.queryState = new my.Query();
|
this.queryState = new my.Query();
|
||||||
this.queryState.bind('change', this.query);
|
this.queryState.bind('change facet:add', function () {
|
||||||
this.queryState.bind('facet:add', this.query);
|
self.query(); // We want to call query() without any arguments.
|
||||||
|
});
|
||||||
// store is what we query and save against
|
// store is what we query and save against
|
||||||
// store will either be the backend or be a memory store if Backend fetch
|
// store will either be the backend or be a memory store if Backend fetch
|
||||||
// tells us to use memory store
|
// tells us to use memory store
|
||||||
|
|||||||
Reference in New Issue
Block a user