diff options
Diffstat (limited to 'assets/js/src')
-rw-r--r-- | assets/js/src/Search.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/assets/js/src/Search.js b/assets/js/src/Search.js index b35c4b67..acacbaf9 100644 --- a/assets/js/src/Search.js +++ b/assets/js/src/Search.js @@ -32,6 +32,8 @@ Search.prototype.listen = function() { }; Search.prototype.keyboardShortcuts = function() { + var self = this; + // Switch view mode for projects: go to the board Mousetrap.bind("v b", function(e) { var link = $(".view-board"); @@ -59,6 +61,15 @@ Search.prototype.keyboardShortcuts = function() { } }); + // Switch view mode for projects: go to the gantt chart + Mousetrap.bind("v g", function(e) { + var link = $(".view-gantt"); + + if (link.length) { + window.location = link.attr('href'); + } + }); + // Focus to the search field Mousetrap.bind("f", function(e) { e.preventDefault(); @@ -68,5 +79,18 @@ Search.prototype.keyboardShortcuts = function() { input.focus(); } }); + + // Reset to the search field + Mousetrap.bind("r", function(e) { + e.preventDefault(); + $("#form-search").val("status:open"); + + if ($('#board').length) { + self.app.board.reloadFilters("status:open"); + } + else { + $("form.search").submit(); + } + }); }; |