Move card to archive, add shortcut key ÷ for Persian keyboard.

Thanks to mohammadZahedian and xet7 !

Fixes https://github.com/wekan/wekan/pull/5589,
fixes https://github.com/wekan/wekan/pull/5576.
pull/5607/head
Lauri Ojansivu 6 months ago
parent aa46b42356
commit 80ea1782f9
  1. 24
      client/lib/keyboard.js

@ -210,6 +210,28 @@ Mousetrap.bind('`', evt => {
}
});
// Same as above, this time for Persian keyboard.
// https://github.com/wekan/wekan/pull/5589#issuecomment-2516776519
Mousetrap.bind('÷', evt => {
const cardId = getSelectedCardId();
if (!cardId) {
return;
}
const currentUserId = Meteor.userId();
if (currentUserId === null) {
return;
}
if (Utils.canModifyBoard()) {
const card = ReactiveCache.getCard(cardId);
card.archive();
// 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('n', evt => {
const cardId = getSelectedCardId();
if (!cardId) {
@ -285,7 +307,7 @@ Template.keyboardShortcuts.helpers({
action: 'shortcut-assign-self',
},
{
keys: ['`'],
keys: ['`', '÷'],
action: 'archive-card',
},
{

Loading…
Cancel
Save