Add users and categories filters on the board

This commit is contained in:
Frederic Guillot
2015-08-21 21:49:53 -04:00
parent 0057400d73
commit 7b664afd61
8 changed files with 88 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
function Search() {
function Search(app) {
this.app = app;
this.keyboardShortcuts();
}
@@ -12,11 +13,21 @@ Search.prototype.focus = function() {
};
Search.prototype.listen = function() {
var self = this;
// Filter helper for search
$(document).on("click", ".filter-helper", function (e) {
e.preventDefault();
$("#form-search").val($(this).data("filter"));
$("form.search").submit();
var filter = $(this).data("filter");
$("#form-search").val(filter);
if ($('#board').length) {
self.app.board.reloadFilters(filter);
}
else {
$("form.search").submit();
}
});
};