diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js index d5f6f5ccaf5..dfac394452c 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js @@ -236,14 +236,23 @@ define(function(require) { }); } + function removeByMode(mode=""){ + if(mode && mode.length){ + var selectHypervisor = $("#template_hypervisor_form", context); + var id = mode+"Radio"; + var option = selectHypervisor.find("#"+id).remove(); + var label = selectHypervisor.find('label[for="'+id+'"]').remove(); + } + } + if (config["mode"] === "kvm"){ $("#kvmRadio", context).click(); - $("#template_hypervisor_form", context).hide(); + removeByMode("vcenter"); $('.only_kvm').show(); $('.only_vcenter').hide(); } else if (config["mode"] === "vcenter"){ $("#vcenterRadio", context).click(); - $("#template_hypervisor_form", context).hide(); + removeByMode("kvm"); $('.only_kvm').hide(); $('.only_vcenter').show(); }