]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
StdRemoveButton: enable by default if no selection model
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 18 Apr 2020 17:26:18 +0000 (19:26 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 18 Apr 2020 17:26:22 +0000 (19:26 +0200)
As in that case we normally want it to be enabled from the start, as
no selection model is there and so we cannot wait until one item is
selected until we enable it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
button/Button.js

index e2fe853d3e2727836306cfa1bf7f8407a82cf341..8d1af4ca70f651dfc29d85e42da91c4691da0bf5 100644 (file)
@@ -155,5 +155,16 @@ Ext.define('Proxmox.button.StdRemoveButton', {
                Ext.Msg.alert(gettext('Error'), response.htmlStatus);
            }
        });
-    }
+    },
+    initComponent: function() {
+       let me = this;
+
+       // enable by default if no seleModel is there and disabled not set
+       if (me.initialConfig.disabled === undefined
+           && (me.selModel === null || me.selModel === false)) {
+           me.disabled = false;
+       }
+
+       me.callParent();
+    },
 });