diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-07-04 14:41:44 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-07-04 14:41:44 -0400 |
commit | 4f3088a33145ecc37a07845fb84b865d80b2c347 (patch) | |
tree | bd3df41c23b5598b41c6243e3a96e72157cb7a74 /assets/js/src | |
parent | cf8aeea6af4077652479f36e1dc81d4de7c44291 (diff) |
Add keyboard shortcut to focus on the search box
Diffstat (limited to 'assets/js/src')
-rw-r--r-- | assets/js/src/base.js | 14 | ||||
-rw-r--r-- | assets/js/src/board.js | 1 |
2 files changed, 14 insertions, 1 deletions
diff --git a/assets/js/src/base.js b/assets/js/src/base.js index 992342e9..2c7e9b34 100644 --- a/assets/js/src/base.js +++ b/assets/js/src/base.js @@ -195,6 +195,20 @@ var Kanboard = (function() { $('#board-selector').trigger('chosen:open'); }); + Mousetrap.bind("f", function(e) { + e.preventDefault(); + + var input = document.getElementById("form-search"); + + if (input) { + input.focus(); + } + }); + + $(document).on("focus", "#form-search", function() { + $(this).val($(this).val()); + }); + $.datepicker.setDefaults($.datepicker.regional[$("body").data("js-lang")]); Kanboard.InitAfterAjax(); diff --git a/assets/js/src/board.js b/assets/js/src/board.js index 356437a1..853511ff 100644 --- a/assets/js/src/board.js +++ b/assets/js/src/board.js @@ -13,7 +13,6 @@ function keyboard_shortcuts() { Mousetrap.bind("n", function() { - Kanboard.OpenPopover( $("#board").data("task-creation-url"), Kanboard.InitAfterAjax |