mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 08:34:30 +00:00
(js) Support backspace AND delete keys
This commit is contained in:
@@ -88,11 +88,13 @@
|
||||
description: l('Add previous item to selection'),
|
||||
callback: _addPreviousCardToSelection
|
||||
}));
|
||||
keys.push(sgHotkeys.createHotkey({
|
||||
key: 'backspace',
|
||||
description: l('Delete selected card or address book'),
|
||||
callback: confirmDeleteSelectedCards
|
||||
}));
|
||||
_.forEach(['backspace', 'delete'], function(hotkey) {
|
||||
keys.push(sgHotkeys.createHotkey({
|
||||
key: hotkey,
|
||||
description: l('Delete selected card or address book'),
|
||||
callback: confirmDeleteSelectedCards
|
||||
}));
|
||||
});
|
||||
|
||||
// Register the hotkeys
|
||||
_.forEach(keys, function(key) {
|
||||
|
||||
@@ -38,14 +38,16 @@
|
||||
|
||||
|
||||
function _registerHotkeys(keys) {
|
||||
keys.push(sgHotkeys.createHotkey({
|
||||
key: 'backspace',
|
||||
description: l('Delete selected card or address book'),
|
||||
callback: function() {
|
||||
if (AddressBook.selectedFolder && !AddressBook.selectedFolder.hasSelectedCard())
|
||||
confirmDelete();
|
||||
}
|
||||
}));
|
||||
_.forEach(['backspace', 'delete'], function(hotkey) {
|
||||
keys.push(sgHotkeys.createHotkey({
|
||||
key: hotkey,
|
||||
description: l('Delete selected card or address book'),
|
||||
callback: function() {
|
||||
if (AddressBook.selectedFolder && !AddressBook.selectedFolder.hasSelectedCard())
|
||||
confirmDelete();
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
// Register the hotkeys
|
||||
_.forEach(keys, function(key) {
|
||||
|
||||
@@ -53,15 +53,17 @@
|
||||
|
||||
|
||||
function _registerHotkeys(keys) {
|
||||
keys.push(sgHotkeys.createHotkey({
|
||||
key: 'backspace',
|
||||
description: l('Delete'),
|
||||
callback: function($event) {
|
||||
if (vm.currentFolder.$selectedCount() === 0)
|
||||
confirmDelete();
|
||||
$event.preventDefault();
|
||||
}
|
||||
}));
|
||||
_.forEach(['backspace', 'delete'], function(hotkey) {
|
||||
keys.push(sgHotkeys.createHotkey({
|
||||
key: hotkey,
|
||||
description: l('Delete'),
|
||||
callback: function($event) {
|
||||
if (vm.currentFolder.$selectedCount() === 0)
|
||||
confirmDelete();
|
||||
$event.preventDefault();
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
// Register the hotkeys
|
||||
_.forEach(keys, function(key) {
|
||||
|
||||
Reference in New Issue
Block a user