mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-14 10:28:14 +00:00
ui: tags: shortcut accept&cancel with keypresses
pressing 'Enter' accepts the current tags and 'Escape' cancels editing Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
1b48b8b7a1
commit
e83ea30e4a
@ -104,10 +104,11 @@ Ext.define('Proxmox.form.Tag', {
|
||||
let key = event.browserEvent.key;
|
||||
switch (key) {
|
||||
case 'Enter':
|
||||
case 'Escape':
|
||||
me.fireEvent('keypress', key);
|
||||
break;
|
||||
case 'ArrowLeft':
|
||||
case 'ArrowRight':
|
||||
case 'Escape':
|
||||
case 'Backspace':
|
||||
case 'Delete':
|
||||
return;
|
||||
|
@ -214,6 +214,13 @@ Ext.define('PVE.panel.TagEditContainer', {
|
||||
destroy: function() {
|
||||
vm.set('tagCount', vm.get('tagCount') - 1);
|
||||
},
|
||||
keypress: function(key) {
|
||||
if (key === 'Enter') {
|
||||
me.editClick();
|
||||
} else if (key === 'Escape') {
|
||||
me.cancelClick();
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user