mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
Merge pull request #5577 from NadavTasher/feature/new-keyboard-shortcut-for-assigning-user
Potential bug(fix?) - Add assign-self keyboard shortcut (old shortcut actually adds)
This commit is contained in:
commit
c44b99d515
2 changed files with 25 additions and 0 deletions
|
|
@ -150,6 +150,26 @@ Mousetrap.bind(numArray, (evt, key) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Mousetrap.bind('m', evt => {
|
||||||
|
const cardId = getSelectedCardId();
|
||||||
|
if (!cardId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentUserId = Meteor.userId();
|
||||||
|
if (currentUserId === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ReactiveCache.getCurrentUser().isBoardMember()) {
|
||||||
|
const card = ReactiveCache.getCard(cardId);
|
||||||
|
card.toggleAssignee(currentUserId);
|
||||||
|
// We should prevent scrolling in card when spacebar is clicked
|
||||||
|
// This should do it according to Mousetrap docs, but it doesn't
|
||||||
|
evt.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Mousetrap.bind('space', evt => {
|
Mousetrap.bind('space', evt => {
|
||||||
const cardId = getSelectedCardId();
|
const cardId = getSelectedCardId();
|
||||||
if (!cardId) {
|
if (!cardId) {
|
||||||
|
|
@ -258,6 +278,10 @@ Template.keyboardShortcuts.helpers({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
keys: ['SPACE'],
|
keys: ['SPACE'],
|
||||||
|
action: 'shortcut-add-self',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
keys: ['n'],
|
||||||
action: 'shortcut-assign-self',
|
action: 'shortcut-assign-self',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -574,6 +574,7 @@
|
||||||
"select-board": "Select Board",
|
"select-board": "Select Board",
|
||||||
"set-wip-limit-value": "Set a limit for the maximum number of tasks in this list",
|
"set-wip-limit-value": "Set a limit for the maximum number of tasks in this list",
|
||||||
"setWipLimitPopup-title": "Set WIP Limit",
|
"setWipLimitPopup-title": "Set WIP Limit",
|
||||||
|
"shortcut-add-self": "Add yourself to current card",
|
||||||
"shortcut-assign-self": "Assign yourself to current card",
|
"shortcut-assign-self": "Assign yourself to current card",
|
||||||
"shortcut-autocomplete-emoji": "Autocomplete emoji",
|
"shortcut-autocomplete-emoji": "Autocomplete emoji",
|
||||||
"shortcut-autocomplete-members": "Autocomplete members",
|
"shortcut-autocomplete-members": "Autocomplete members",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue