From ed9d64c359f2f9a37dfbcd7aed094d8307569de5 Mon Sep 17 00:00:00 2001 From: Jorge Lobo <47326048+jloboescalona2@users.noreply.github.com> Date: Thu, 18 Jul 2019 15:51:00 +0200 Subject: [PATCH] B #3435: remove option by mode (#3528) Signed-off-by: Jorge Lobo --- .../form-panels/create/wizard-tabs/general.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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(); }