X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=static%2Fsrc%2Finstancehandler%2Finstance_create.js;h=124fb05ef3f0416d3bfb30e2712a9ecccd9db91a;hb=8961b0e0861f6c45611c43e20b9664abf300f4c3;hp=3cce0c4401596881d349669863c7333891d5ad5d;hpb=cf3a1f01c2b7ef2e76f8090fc995b74e95835306;p=osm%2FLW-UI.git diff --git a/static/src/instancehandler/instance_create.js b/static/src/instancehandler/instance_create.js index 3cce0c4..124fb05 100644 --- a/static/src/instancehandler/instance_create.js +++ b/static/src/instancehandler/instance_create.js @@ -14,6 +14,7 @@ limitations under the License. */ + function openModalCreatePDU(args) { var select2_groups = $('#pdu_vim_accounts').select2({ placeholder: 'Select Vims', @@ -148,14 +149,13 @@ function openModalCreateNSI(args) { } } }); - - if (args.descriptor_id) { + if (args.template_id) { // Set the value, creating a new option if necessary - if ($('#nstId').find("option[value='" + args.descriptor_id + "']").length) { - $('#nstId').val(args.descriptor_id).trigger('change'); + if ($('#nstId').find("option[value='" + args.template_id + "']").length) { + $('#nstId').val(args.template_id).trigger('change'); } else { // Create a DOM Option and pre-select by default - var newOption = new Option(args.descriptor_name, args.descriptor_id, true, true); + var newOption = new Option(args.template_name, args.template_id, true, true); // Append it to the select $('#nstId').append(newOption).trigger('change'); }