Merge pull request #356 from okfn/querystate-fix

Fixes a bug in querystate handling.
This commit is contained in:
Rufus Pollock 2013-05-17 07:08:50 -07:00
commit 033848290a

View File

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