[pve-devel] [PATCH pve-manager] SafeDestroy.js: allow to submit the form with Enter key
Emmanuel Kasper
e.kasper at proxmox.com
Thu Mar 31 10:07:12 CEST 2016
also set focus on the confirm field of the Destroy Window on display
---
www/manager6/window/SafeDestroy.js | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/www/manager6/window/SafeDestroy.js b/www/manager6/window/SafeDestroy.js
index ec4a2f5..fea9594 100644
--- a/www/manager6/window/SafeDestroy.js
+++ b/www/manager6/window/SafeDestroy.js
@@ -53,6 +53,12 @@ Ext.define('PVE.window.SafeDestroy', {
} else {
removeButton.disable();
}
+ },
+ specialkey: function (field, event) {
+ var removeButton = this.lookupReference('removeButton');
+ if (!removeButton.isDisabled() && event.getKey() == event.ENTER) {
+ removeButton.fireEvent('click', removeButton, event);
+ }
}
},
'button[reference=removeButton]': {
@@ -102,7 +108,12 @@ Ext.define('PVE.window.SafeDestroy', {
fieldLabel: gettext('Please enter the {item.type} ID to confirm'),
},
hideTrigger: true,
- allowBlank: false
+ allowBlank: false,
+ listeners: {
+ afterrender: function(field) {
+ field.focus(10);
+ }
+ }
}
],
}
--
2.1.4
More information about the pve-devel
mailing list