add custom submittext to Edit Window

we will use this for the restore window

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-11-14 11:17:04 +01:00 committed by Dietmar Maurer
parent fa6dc53bcc
commit ffea05ec4e

View File

@ -23,6 +23,9 @@ Ext.define('Proxmox.window.Edit', {
// set to true if you want an Remove button (instead of Create)
isRemove: false,
// custom submitText
submitText: undefined,
backgroundDelay: 0,
// needed for finding the reference to submitbutton
@ -221,7 +224,9 @@ Ext.define('Proxmox.window.Edit', {
var submitText;
if (me.create) {
if (me.isAdd) {
if (me.submitText) {
submitText = me.submitText;
} else if (me.isAdd) {
submitText = gettext('Add');
} else if (me.isRemove) {
submitText = gettext('Remove');
@ -229,7 +234,7 @@ Ext.define('Proxmox.window.Edit', {
submitText = gettext('Create');
}
} else {
submitText = gettext('OK');
submitText = me.submitText || gettext('OK');
}
var submitBtn = Ext.create('Ext.Button', {