]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
window: edit: simplify setting submit button
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 20 Apr 2024 18:41:09 +0000 (20:41 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 20 Apr 2024 18:41:11 +0000 (20:41 +0200)
Since the reset-form functionality got moved into the header tools in
commit 046ec35 ("fix #5277: move reset button into window header
toolbar") we can unconditionally set the initial buttons, as those
will always just contain the submit one now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/window/Edit.js

index 17b57a6f8dafbd3d064ceabc09fe0417274f82d3..1c2e63f8c0508a24373964a0dc630c12234f60c7 100644 (file)
@@ -349,10 +349,9 @@ Ext.define('Proxmox.window.Edit', {
            me.title = Proxmox.Utils.dialog_title(me.subject, me.isCreate, me.isAdd);
        }
 
-       if (me.isCreate || !me.showReset) {
-           me.buttons = [submitBtn];
-       } else {
-           me.buttons = [submitBtn];
+       me.buttons = [submitBtn];
+
+       if (!me.isCreate && me.showReset)) {
            me.tools = [resetTool];
        }