Skip to content

Commit

Permalink
B OpenNebula#3435: remove option by mode (OpenNebula#3528)
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
  • Loading branch information
jloboescalona2 authored and Tino Vázquez committed Jul 18, 2019
1 parent a7c7f00 commit ed9d64c
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit ed9d64c

Please sign in to comment.