100be003 by Adam Heath

Breaking change; fix global singleton issue around Facets.

1 parent 5060c174
......@@ -4,6 +4,7 @@ define(function(require) {
var Backbone = require('backbone');
var Facets = require('solr/model/Facets');
var Facet = require('solr/model/Facet');
var Ordering = require('solr/model/Ordering');
var QueryTextField = require('solr/model/QueryTextField');
var Util = require('solr/model/Util');
......@@ -24,7 +25,11 @@ define(function(require) {
defaults: function defaults() {
var constructor = this.constructor;
var formNameMap = {};
var facets = new Facets(this.constructor.facets, {search: this});
var constructorFacets = {};
_.each(this.constructor.facets, function(facetInfo, facetName) {
constructorFacets[facetName] = new Facet(facetInfo.data, facetInfo.options);
});
var facets = new Facets(constructorFacets, {search: this});
_.each(facets.values(), function(facet) {
var formName = facet.get('formName');
if (formName) {
......