add kanban button is keyboard accessible

This commit is contained in:
daria 2024-05-20 19:58:36 +03:00
parent d2adb5d068
commit 8397234933
1 changed files with 6 additions and 0 deletions

View File

@ -899,6 +899,7 @@ define([
if (migrated) { framework.localChange(); } if (migrated) { framework.localChange(); }
var addBoardDefault = document.getElementById('kanban-addboard'); var addBoardDefault = document.getElementById('kanban-addboard');
$(addBoardDefault).attr('tabindex', 0);
$(addBoardDefault).attr('title', Messages.kanban_addBoard); $(addBoardDefault).attr('title', Messages.kanban_addBoard);
addBoardDefault.addEventListener('click', function () { addBoardDefault.addEventListener('click', function () {
if (framework.isReadOnly() || framework.isLocked()) { return; } if (framework.isReadOnly() || framework.isLocked()) { return; }
@ -920,6 +921,11 @@ define([
}); });
kanban.onChange(); kanban.onChange();
}); });
document.addEventListener('keydown', function (event) {
if (event.key === 'Enter') {
addBoardDefault.click();
}
});
var $container = $('#cp-app-kanban-content'); var $container = $('#cp-app-kanban-content');
var $cContainer = $('#cp-app-kanban-container'); var $cContainer = $('#cp-app-kanban-container');