From 4f3088a33145ecc37a07845fb84b865d80b2c347 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 4 Jul 2015 14:41:44 -0400 Subject: Add keyboard shortcut to focus on the search box --- assets/js/src/base.js | 14 ++++++++++++++ assets/js/src/board.js | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'assets/js/src') 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 -- cgit v1.2.3