[Kimchi-devel] [PATCH V2] Bugfix: Cancel option not working properly in New Storage Define

Wen Wang wenwang at linux.vnet.ibm.com
Thu Sep 25 08:20:47 UTC 2014


From: Wen Wang <wenwang at linux.vnet.ibm.com>

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 at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.storagepool_add_main.js |    6 +++---
 1 files changed, 3 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..c167acd 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-loading').show();
+                $('#pool-doAdd').hide();
                 kimchi.createStoragePool(formData, function() {
                     kimchi.doListStoragePools();
                     kimchi.window.close();
-- 
1.7.1




More information about the Kimchi-devel mailing list