From cfa111f5b21397914033341c141fa851dee0a0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 4 Sep 2015 11:57:12 +0200 Subject: [PATCH] Feature #3963: input values also change the name selector --- .../form-panels/create/wizard-tabs/other.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other.js index 0fe2c15e56..5f65700ab3 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other.js @@ -97,6 +97,8 @@ define(function(require) { html += ''; $(".device_name", tr).html(html); + + $("input", tr).trigger("change"); }, error: function(request, error_json){ console.error("There was an error requesting the PCI devices: "+ @@ -117,6 +119,18 @@ define(function(require) { $('input[wizard_field="VENDOR"]', tr).val( option.attr("vendor") ); }); + context.on("change", ".pci_devices tbody input", function(){ + var tr = $(this).closest('tr'); + + var opt = + $('option'+ + '[device="'+$('input[wizard_field="DEVICE"]', tr).val()+'"]'+ + '[class="'+$('input[wizard_field="CLASS"]', tr).val()+'"]'+ + '[vendor="'+$('input[wizard_field="VENDOR"]', tr).val()+'"]', tr); + + opt.attr('selected', 'selected'); + }); + context.on("click", ".pci_devices i.remove-tab", function(){ var tr = $(this).closest('tr'); tr.remove();