diff --git a/src/main/webapp/scripts/facets/list-facet.js b/src/main/webapp/scripts/facets/list-facet.js index eb0d5641e..6ef38d153 100644 --- a/src/main/webapp/scripts/facets/list-facet.js +++ b/src/main/webapp/scripts/facets/list-facet.js @@ -20,6 +20,12 @@ ListFacet.reconstruct = function(div, uiState) { return new ListFacet(div, uiState.c, uiState.o, uiState.s); }; +ListFacet.prototype.reset = function() { + this._selection = []; + this._blankChoice = null; + this._errorChoice = null; +}; + ListFacet.prototype.getUIState = function() { var json = { c: this.getJSON(), diff --git a/src/main/webapp/scripts/facets/range-facet.js b/src/main/webapp/scripts/facets/range-facet.js index aa98dde1c..aafb59a1a 100644 --- a/src/main/webapp/scripts/facets/range-facet.js +++ b/src/main/webapp/scripts/facets/range-facet.js @@ -20,23 +20,28 @@ function RangeFacet(div, config, options) { this._initializedUI = false; } -RangeFacet.prototype._setDefaults = function() { +RangeFacet.prototype.reset = function() { switch (this._config.mode) { case "min": this._from = this._config.min; + this._sliderDiv.slider("value", this._from); break; case "max": this._to = this._config.max; + this._sliderDiv.slider("value", this._to); break; default: this._from = this._config.min; this._to = this._config.max; + this._sliderDiv.slider("values", 0, this._from); + this._sliderDiv.slider("values", 1, this._to); } - this._selectNumeric = true; this._selectNonNumeric = true; this._selectBlank = true; this._selectError = true; + + this._setRangeIndicators(); }; RangeFacet.reconstruct = function(div, uiState) { @@ -104,27 +109,7 @@ RangeFacet.prototype._initializeUI = function() { $('').text(this._config.name).appendTo(headerDiv); var resetButton = $('').addClass("facet-choice-link").text("reset").click(function() { - switch (self._config.mode) { - case "min": - self._from = self._config.min; - self._sliderDiv.slider("value", self._from); - break; - case "max": - self._to = self._config.max; - self._sliderDiv.slider("value", self._to); - break; - default: - self._from = self._config.min; - self._to = self._config.max; - self._sliderDiv.slider("values", 0, self._from); - self._sliderDiv.slider("values", 1, self._to); - } - self._selectNumeric = true; - self._selectNonNumeric = true; - self._selectBlank = true; - self._selectError = true; - - self._setRangeIndicators(); + self.reset(); self._updateRest(); }).prependTo(headerDiv); @@ -355,11 +340,6 @@ RangeFacet.prototype.render = function() { this._renderOtherChoices(); }; -RangeFacet.prototype._reset = function() { - this._setDefaults(); - this._updateRest(); -}; - RangeFacet.prototype._remove = function() { ui.browsingEngine.removeFacet(this); diff --git a/src/main/webapp/scripts/facets/text-search-facet.js b/src/main/webapp/scripts/facets/text-search-facet.js index 36bdcb9d2..94dc82123 100644 --- a/src/main/webapp/scripts/facets/text-search-facet.js +++ b/src/main/webapp/scripts/facets/text-search-facet.js @@ -13,6 +13,11 @@ TextSearchFacet.reconstruct = function(div, uiState) { return new TextSearchFacet(div, uiState.c, uiState.o); }; +TextSearchFacet.prototype.reset = function() { + this._query = null; + this._div.find(".input-container input").each(function() { this.value = ""; }); +}; + TextSearchFacet.prototype.getUIState = function() { var json = { c: this.getJSON(), diff --git a/src/main/webapp/scripts/project/browsing-engine.js b/src/main/webapp/scripts/project/browsing-engine.js index c8830341e..b70097623 100644 --- a/src/main/webapp/scripts/project/browsing-engine.js +++ b/src/main/webapp/scripts/project/browsing-engine.js @@ -44,10 +44,16 @@ BrowsingEngine.prototype._initializeUI = function() { var self = this; this._div.html( - '