summaryrefslogtreecommitdiff
path: root/assets/js/src/board.js
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-02-16 23:02:47 -0500
committerFrederic Guillot <fred@kanboard.net>2015-02-16 23:02:47 -0500
commit0db66953a78b704e3710b970ab11b87058bb3859 (patch)
tree3e2ac3d2557dbe13d479dbb93d13463c270bb1fe /assets/js/src/board.js
parentba3abb5940bd00c87ffe594eec83b95d428a575f (diff)
Use chosen for board dropdown filters
Diffstat (limited to 'assets/js/src/board.js')
-rw-r--r--assets/js/src/board.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/assets/js/src/board.js b/assets/js/src/board.js
index 4d5a6917..cd1e0361 100644
--- a/assets/js/src/board.js
+++ b/assets/js/src/board.js
@@ -315,13 +315,19 @@ Kanboard.Board = (function() {
{
var projectId = $('#board').data('project-id');
+ $("#form-user_id").chosen({
+ width: "180px"
+ });
+
$("#form-user_id").change(function(e) {
- $(this).parent().toggleClass("filter-on", $(this).val() != -1);
filter_apply();
});
+ $("#form-category_id").chosen({
+ width: "200px"
+ });
+
$("#form-category_id").change(function(e) {
- $(this).parent().toggleClass("filter-on", $(this).val() != -1);
filter_apply();
});
@@ -339,10 +345,10 @@ Kanboard.Board = (function() {
// Get and set filters from localStorage
$("#form-user_id").val(Kanboard.GetStorageItem("board_filter_" + projectId + "_form-user_id") || -1);
- $("#form-user_id").parent().toggleClass("filter-on", $("#form-user_id").val() != -1);
+ $("#form-user_id").trigger("chosen:updated");
$("#form-category_id").val(Kanboard.GetStorageItem("board_filter_" + projectId + "_form-category_id") || -1);
- $("#form-category_id").parent().toggleClass("filter-on", $("#form-category_id").val() != -1);
+ $("#form-category_id").trigger("chosen:updated");
if (+Kanboard.GetStorageItem("board_filter_" + projectId + "_filter-due-date")) {
$("#filter-due-date").addClass("filter-on");