(js) Support backspace AND delete keys

This commit is contained in:
Francis Lachapelle
2017-06-14 13:37:13 -04:00
parent 67b9ef0b8b
commit 7464c2e680
7 changed files with 56 additions and 43 deletions
@@ -147,14 +147,16 @@
description: l('Flagged'),
callback: _unlessInDialog(angular.bind(stateMessage, stateMessage.toggleFlag))
}));
keys.push(sgHotkeys.createHotkey({
key: 'backspace',
callback: _unlessInDialog(function($event) {
if (vm.mailbox.$selectedCount() === 0)
deleteMessage();
$event.preventDefault();
})
}));
_.forEach(['backspace', 'delete'], function(hotkey) {
keys.push(sgHotkeys.createHotkey({
key: hotkey,
callback: _unlessInDialog(function($event) {
if (vm.mailbox.$selectedCount() === 0)
deleteMessage();
$event.preventDefault();
}),
}));
});
// Register the hotkeys
_.forEach(keys, function(key) {