diff options
Diffstat (limited to 'assets/js/src/Search.js')
-rw-r--r-- | assets/js/src/Search.js | 58 |
1 files changed, 1 insertions, 57 deletions
diff --git a/assets/js/src/Search.js b/assets/js/src/Search.js index f6409f54..b61710a4 100644 --- a/assets/js/src/Search.js +++ b/assets/js/src/Search.js @@ -15,6 +15,7 @@ Kanboard.Search.prototype.focus = function() { }); }; +// TODO: rewrite this code Kanboard.Search.prototype.listen = function() { $(document).on("click", ".filter-helper", function (e) { e.preventDefault(); @@ -38,60 +39,3 @@ Kanboard.Search.prototype.listen = function() { $("form.search").submit(); }); }; - -Kanboard.Search.prototype.goToView = function(label) { - var link = $(label); - - if (link.length) { - window.location = link.attr('href'); - } -}; - -Kanboard.Search.prototype.keyboardShortcuts = function() { - var self = this; - - // Switch view mode for projects: go to the overview page - Mousetrap.bind("v o", function() { - self.goToView(".view-overview"); - }); - - // Switch view mode for projects: go to the board - Mousetrap.bind("v b", function() { - self.goToView(".view-board"); - }); - - // Switch view mode for projects: go to the calendar - Mousetrap.bind("v c", function() { - self.goToView(".view-calendar"); - }); - - // Switch view mode for projects: go to the listing - Mousetrap.bind("v l", function() { - self.goToView(".view-listing"); - }); - - // Switch view mode for projects: go to the gantt chart - Mousetrap.bind("v g", function() { - self.goToView(".view-gantt"); - }); - - // Focus to the search field - Mousetrap.bind("f", function(e) { - e.preventDefault(); - var input = document.getElementById("form-search"); - - if (input) { - input.focus(); - } - }); - - // Reset to the search field - Mousetrap.bind("r", function(e) { - e.preventDefault(); - var reset = $(".filter-reset").data("filter"); - var input = $("#form-search"); - - input.val(reset); - $("form.search").submit(); - }); -}; |