Skip to content

Commit

Permalink
Fixing clear search on command+a.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelclay committed Feb 10, 2014
1 parent 8daacaa commit 958e94c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions lib/js/views/search_box.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
Expand Down
8 changes: 3 additions & 5 deletions lib/js/views/search_input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 958e94c

Please sign in to comment.