mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-28 17:14:56 +00:00
displayedit: fixup to correct version
it seems I made an error and applied an older version.. Apply the correct one[0] with Dominiks comment addressed[1]. [0]: https://pve.proxmox.com/pipermail/pve-devel/2020-April/043037.html [1]: https://pve.proxmox.com/pipermail/pve-devel/2020-April/043043.html Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
809603790a
commit
a307714b53
@ -1,10 +1,12 @@
|
||||
Ext.define('Proxmox.form.field.DisplayEdit', {
|
||||
extend: 'Ext.form.FieldContainer',
|
||||
alias: ['widget.pmxDisplayEditField'],
|
||||
alias: 'widget.pmxDisplayEditField',
|
||||
|
||||
viewModel: {
|
||||
parent: null,
|
||||
data: {
|
||||
editable: false,
|
||||
value: undefined,
|
||||
},
|
||||
},
|
||||
|
||||
@ -30,25 +32,30 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
|
||||
|
||||
let displayConfig = {
|
||||
xtype: me.displayType,
|
||||
bind: {
|
||||
hidden: '{editable}',
|
||||
disabled: '{editable}',
|
||||
},
|
||||
bind: {},
|
||||
};
|
||||
Ext.applyIf(displayConfig, me.initialConfig);
|
||||
delete displayConfig.editConfig;
|
||||
delete displayConfig.editable;
|
||||
|
||||
let editConfig = Ext.apply({}, me.editConfig); // clone, not reference!
|
||||
let editConfig = Ext.apply({}, me.editConfig);
|
||||
Ext.applyIf(editConfig, {
|
||||
xtype: 'textfield',
|
||||
bind: {
|
||||
hidden: '{!editable}',
|
||||
disabled: '{!editable}',
|
||||
},
|
||||
bind: {},
|
||||
});
|
||||
Ext.applyIf(editConfig, displayConfig);
|
||||
|
||||
Ext.applyIf(displayConfig.bind, {
|
||||
hidden: '{editable}',
|
||||
disabled: '{editable}',
|
||||
value: '{value}',
|
||||
});
|
||||
Ext.applyIf(editConfig.bind, {
|
||||
hidden: '{!editable}',
|
||||
disabled: '{!editable}',
|
||||
value: '{value}',
|
||||
});
|
||||
|
||||
// avoid glitch, start off correct even before viewmodel fixes it
|
||||
editConfig.disabled = editConfig.hidden = !me.editable;
|
||||
displayConfig.disabled = displayConfig.hidden = !!me.editable;
|
||||
@ -57,8 +64,8 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
|
||||
|
||||
Ext.apply(me, {
|
||||
items: [
|
||||
displayConfig,
|
||||
editConfig,
|
||||
displayConfig,
|
||||
],
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user