Add users and categories filters on the board
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
function App() {
|
||||
this.board = new Board(this);
|
||||
this.markdown = new Markdown();
|
||||
this.sidebar = new Sidebar();
|
||||
this.search = new Search();
|
||||
this.search = new Search(this);
|
||||
this.swimlane = new Swimlane();
|
||||
this.dropdown = new Dropdown();
|
||||
this.tooltip = new Tooltip(this);
|
||||
|
||||
@@ -25,6 +25,23 @@ Board.prototype.poll = function() {
|
||||
}
|
||||
};
|
||||
|
||||
Board.prototype.reloadFilters = function(search) {
|
||||
this.app.showLoadingIcon();
|
||||
|
||||
$.ajax({
|
||||
cache: false,
|
||||
url: $("#board").data("reload-url"),
|
||||
contentType: "application/json",
|
||||
type: "POST",
|
||||
processData: false,
|
||||
data: JSON.stringify({
|
||||
search: search
|
||||
}),
|
||||
success: this.refresh.bind(this),
|
||||
error: this.app.hideLoadingIcon.bind(this)
|
||||
});
|
||||
};
|
||||
|
||||
Board.prototype.check = function() {
|
||||
if (this.app.isVisible()) {
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user