Add keyboard shortcut to focus on the search box

This commit is contained in:
Frederic Guillot
2015-07-04 14:41:44 -04:00
parent cf8aeea6af
commit 4f3088a331
5 changed files with 24 additions and 9 deletions

View File

@@ -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();

View File

@@ -13,7 +13,6 @@
function keyboard_shortcuts()
{
Mousetrap.bind("n", function() {
Kanboard.OpenPopover(
$("#board").data("task-creation-url"),
Kanboard.InitAfterAjax