Commit 09109431 authored by Dietmar Maurer's avatar Dietmar Maurer

correctly check for undefined values

parent c838c7a3
......@@ -286,7 +286,10 @@ Ext.define('PVE.qemu.HardwareView', {
selModel: sm,
disabled: true,
enableFn: function(rec) {
if (!rec || rec.data.key.match(/^unused\d+/) || rec.data['pending'] || rec.data['delete']) {
if (!rec || rec.data.key.match(/^unused\d+/) || rec.data['delete']) {
return false;
}
if (Ext.isDefined(rec.data.pending) && (rec.data.pending !== '')) {
return false;
}
var rowdef = rows[rec.data.key];
......@@ -344,7 +347,7 @@ Ext.define('PVE.qemu.HardwareView', {
if (!rec) {
return false;
}
if(rec.data['delete']){
if (rec.data['delete']) {
return false;
}
var rowdef = rows[rec.data.key];
......@@ -363,7 +366,7 @@ Ext.define('PVE.qemu.HardwareView', {
reload();
},
failure: function (response, opts) {
Ext.Msg.alert('Error',response.htmlStatus);
Ext.Msg.alert('Error', response.htmlStatus);
}
});
}
......@@ -377,12 +380,16 @@ Ext.define('PVE.qemu.HardwareView', {
if (!rec) {
return false;
}
if(!rec.data['pending'] && !rec.data['delete']){
return false;
if (Ext.isDefined(rec.data.pending) && (rec.data.pending !== '')) {
return true;
}
var rowdef = rows[rec.data.key];
if (rec.data['delete']) {
return true;
}
return false;
},
handler: function(b, e, rec) {
PVE.Utils.API2Request({
......
......@@ -338,9 +338,10 @@ Ext.define('PVE.qemu.Options', {
return;
}
if(rec.data['pending'] || rec.data['delete']){
if ((Ext.isDefined(rec.data.pending) && (rec.data.pending !== '')) ||
rec.data['delete']) {
revert_btn.setDisabled(false);
}else {
} else {
revert_btn.setDisabled(true);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment