mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-08 21:51:01 +00:00
window password edit: refactor to more schematic code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
6dc34e5525
commit
18a6f207ef
@ -1,13 +1,14 @@
|
|||||||
Ext.define('Proxmox.window.PasswordEdit', {
|
Ext.define('Proxmox.window.PasswordEdit', {
|
||||||
extend: 'Proxmox.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: 'proxmoxWindowPasswordEdit',
|
alias: 'proxmoxWindowPasswordEdit',
|
||||||
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
subject: gettext('Password'),
|
subject: gettext('Password'),
|
||||||
|
|
||||||
url: '/api2/extjs/access/password',
|
url: '/api2/extjs/access/password',
|
||||||
|
|
||||||
fieldDefaults: {
|
fieldDefaults: {
|
||||||
labelWidth: 120
|
labelWidth: 120,
|
||||||
},
|
},
|
||||||
|
|
||||||
items: [
|
items: [
|
||||||
@ -19,13 +20,9 @@ Ext.define('Proxmox.window.PasswordEdit', {
|
|||||||
allowBlank: false,
|
allowBlank: false,
|
||||||
name: 'password',
|
name: 'password',
|
||||||
listeners: {
|
listeners: {
|
||||||
change: function(field){
|
change: (field) => field.next().validate(),
|
||||||
field.next().validate();
|
blur: (field) => field.next().validate(),
|
||||||
},
|
},
|
||||||
blur: function(field){
|
|
||||||
field.next().validate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'textfield',
|
xtype: 'textfield',
|
||||||
@ -35,22 +32,14 @@ Ext.define('Proxmox.window.PasswordEdit', {
|
|||||||
allowBlank: false,
|
allowBlank: false,
|
||||||
vtype: 'password',
|
vtype: 'password',
|
||||||
initialPassField: 'password',
|
initialPassField: 'password',
|
||||||
submitValue: false
|
submitValue: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'hiddenfield',
|
xtype: 'hiddenfield',
|
||||||
name: 'userid'
|
name: 'userid',
|
||||||
}
|
cbind: {
|
||||||
|
value: '{userid}',
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
initComponent : function() {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
if (!me.userid) {
|
|
||||||
throw "no userid specified";
|
|
||||||
}
|
|
||||||
|
|
||||||
me.callParent();
|
|
||||||
me.down('[name=userid]').setValue(me.userid);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user