diff --git a/lib/js/views/search_box.js b/lib/js/views/search_box.js index 6a95535..596ed00 100644 --- a/lib/js/views/search_box.js +++ b/lib/js/views/search_box.js @@ -145,9 +145,7 @@ VS.ui.SearchBox = Backbone.View.extend({ // since its position is unknown by the time the collection triggers this // remove callback. removedFacet : function (facet, query, options) { - if (this.app.options.callbacks.removedFacet) { - this.app.options.callbacks.removedFacet(facet, query, options); - } + this.app.options.callbacks.removedFacet(facet, query, options); }, // Renders each facet as a searchFacet view. @@ -222,7 +220,7 @@ VS.ui.SearchBox = Backbone.View.extend({ this.focusSearch(e); }, this); - if (this.app.options.callbacks.clearSearch) { + if (this.app.options.callbacks.clearSearch != $.noop) { this.app.options.callbacks.clearSearch(actualClearSearch); } else { actualClearSearch(); diff --git a/lib/js/views/search_input.js b/lib/js/views/search_input.js index a9e0d66..0c09ccc 100644 --- a/lib/js/views/search_input.js +++ b/lib/js/views/search_input.js @@ -320,11 +320,9 @@ VS.ui.SearchInput = Backbone.View.extend({ this.box.trigger('resize.autogrow', e); var query = this.box.val(); var prefixes = []; - if (this.app.options.callbacks.facetMatches) { - this.app.options.callbacks.facetMatches(function(p) { - prefixes = p; - }); - } + this.app.options.callbacks.facetMatches(function(p) { + prefixes = p; + }); var labels = _.map(prefixes, function(prefix) { if (prefix.label) return prefix.label; else return prefix;