
From: Wen Wang <wenwang@linux.vnet.ibm.com> V2 -> V3: Make the button style change properly with different storage pool types. V1 -> V2: Make the "Create" button change style and disable the input box only when clicked on "ok" in "confirm" diaguage. The button and the input style stay the same if user cancel the creating job. This bug fix the defect that when adding a new logical storage pool, a confrim message box show up and when canceling it, the inputbox as well as button "Create" is still disabled. Signed-off-by: Wen Wang <wenwang@linux.vnet.ibm.com> --- ui/js/src/kimchi.storagepool_add_main.js | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js index 4f1f943..07e7fbe 100644 --- a/ui/js/src/kimchi.storagepool_add_main.js +++ b/ui/js/src/kimchi.storagepool_add_main.js @@ -352,8 +352,6 @@ kimchi.validateLogicalForm = function () { kimchi.addPool = function(event) { if (kimchi.validateForm()) { - $('#pool-doAdd').hide(); - $('#pool-loading').show(); var formData = $('#form-pool-add').serializeObject(); delete formData.authname; var poolType = $('#poolTypeId').selectMenu('value'); @@ -390,7 +388,6 @@ kimchi.addPool = function(event) { } else if (poolType === 'scsi'){ formData.source = { adapter_name: $('#scsiAdapter').selectMenu('value') }; } - $('input', '#form-pool-add').attr('disabled','disabled'); if (poolType === 'logical') { var settings = { title : i18n['KCHAPI6001M'], @@ -399,6 +396,9 @@ kimchi.addPool = function(event) { cancel : i18n['KCHAPI6003M'] }; kimchi.confirm(settings, function() { + $('input', '#form-pool-add').attr('disabled','disabled'); + $('#pool-doAdd').hide(); + $('#pool-loading').show(); kimchi.createStoragePool(formData, function() { kimchi.doListStoragePools(); kimchi.window.close(); @@ -411,6 +411,9 @@ kimchi.addPool = function(event) { }, function() { }); } else { + $('input', '#form-pool-add').attr('disabled','disabled'); + $('#pool-doAdd').hide(); + $('#pool-loading').show(); kimchi.createStoragePool(formData, function() { kimchi.doListStoragePools(); kimchi.window.close(); -- 1.7.1