mirror of https://github.com/apache/cloudstack.git
Instance wizard: Don't try to add a new row if list view isn't present
This commit is contained in:
parent
8a94f5c5da
commit
017885b5f1
|
|
@ -40,27 +40,32 @@
|
|||
|
||||
args.action({
|
||||
// Populate data
|
||||
context: context,
|
||||
data: data,
|
||||
response: {
|
||||
success: function(args) {
|
||||
var $loading = $('.list-view').listView('prependItem', {
|
||||
data: [
|
||||
{
|
||||
name: data.displayname ? data.displayname : _l('label.new.vm'),
|
||||
zonename: $wizard.find('select[name=zoneid] option').filter(function() {
|
||||
return $(this).val() == data.zoneid;
|
||||
}).html(),
|
||||
state: 'Creating'
|
||||
}
|
||||
],
|
||||
actionFilter: function(args) { return []; }
|
||||
});
|
||||
var $listView = $('.list-view.instances');
|
||||
|
||||
if ($listView.size()) {
|
||||
var $loading = $('.list-view.instances').listView('prependItem', {
|
||||
data: [
|
||||
{
|
||||
name: data.displayname ? data.displayname : _l('label.new.vm'),
|
||||
zonename: $wizard.find('select[name=zoneid] option').filter(function() {
|
||||
return $(this).val() == data.zoneid;
|
||||
}).html(),
|
||||
state: 'Creating'
|
||||
}
|
||||
],
|
||||
actionFilter: function(args) { return []; }
|
||||
});
|
||||
}
|
||||
|
||||
listViewArgs.complete({
|
||||
_custom: args._custom,
|
||||
messageArgs: cloudStack.serializeForm($form),
|
||||
$item: $loading
|
||||
});
|
||||
$item: $listView.size()? $loading : $('<div>')
|
||||
});
|
||||
|
||||
close();
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue