[pve-devel] [PATCH manager 1/3] fix default button selection on dangerous options
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri May 12 12:14:19 CEST 2017
The old method:
> Ext.MessageBox.defaultButton = me.dangerous ? 2 : 1;
does not works for me at all (neither firefox nor chromium), the yes
button was always focused.
Fix this, as else a to fast "Enter" press can cause more problems
than needed.
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
www/manager6/button/Button.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/www/manager6/button/Button.js b/www/manager6/button/Button.js
index 38668997..d0020cc5 100644
--- a/www/manager6/button/Button.js
+++ b/www/manager6/button/Button.js
@@ -40,12 +40,12 @@ Ext.define('PVE.button.Button', {
if (Ext.isFunction(me.confirmMsg)) {
msg = me.confirmMsg(rec);
}
- Ext.MessageBox.defaultButton = me.dangerous ? 2 : 1;
Ext.Msg.show({
title: gettext('Confirm'),
icon: me.dangerous ? Ext.Msg.WARNING : Ext.Msg.QUESTION,
msg: msg,
buttons: Ext.Msg.YESNO,
+ defaultFocus: me.dangerous ? 'no' : 'yes',
callback: function(btn) {
if (btn !== 'yes') {
return;
--
2.11.0
More information about the pve-devel
mailing list