From 0db66953a78b704e3710b970ab11b87058bb3859 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 16 Feb 2015 23:02:47 -0500 Subject: Use chosen for board dropdown filters --- assets/js/src/board.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'assets/js/src/board.js') 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"); -- cgit v1.2.3