Skip to content

Commit

Permalink
Merge branch 'master' of github.com:documentcloud/visualsearch
Browse files Browse the repository at this point in the history
# By José Luis Di Biase
# Via José Luis Di Biase (1) and Samuel Clay (1)
* 'master' of github.com:documentcloud/visualsearch:
  Expose removedFacet as a callback
  Add clearSearch in defaults callbacks
  • Loading branch information
samuelclay committed Feb 9, 2014
2 parents 9138e83 + 2f43745 commit c56f040
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/js/views/search_box.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ VS.ui.SearchBox = Backbone.View.extend({
// remaining facet is selected, but this is handled by the facet's view,
// since its position is unknown by the time the collection triggers this
// remove callback.
removedFacet : function (facet, query, options) {},
removedFacet : function (facet, query, options) {
if (this.app.options.callbacks.removedFacet) {
this.app.options.callbacks.removedFacet(facet, query, options);
}
},

// Renders each facet as a searchFacet view.
renderFacets : function() {
Expand Down
4 changes: 3 additions & 1 deletion lib/js/visualsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
focus : $.noop,
blur : $.noop,
facetMatches : $.noop,
valueMatches : $.noop
valueMatches : $.noop,
clearSearch : $.noop,
removedFacet : $.noop,
}
};
this.options = _.extend({}, defaults, options);
Expand Down

0 comments on commit c56f040

Please sign in to comment.