Reviewed-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
On 06/26/2014 02:47 PM, lvroyce(a)linux.vnet.ibm.com wrote:
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Default value for pool and volume were passed when path parameter
is set. Fix this wrong behavior by delete the default values.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_storage_add.main.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.guest_storage_add.main.js
b/ui/js/src/kimchi.guest_storage_add.main.js
index 6af00cc..80045d3 100644
--- a/ui/js/src/kimchi.guest_storage_add.main.js
+++ b/ui/js/src/kimchi.guest_storage_add.main.js
@@ -50,6 +50,16 @@ kimchi.guest_storage_add_main = function() {
}
});
+ if ($(".path-section").hasClass('hidden')) {
+ $(poolTextbox).val('default');
+ $(poolTextbox).change();
+ $(pathTextbox).val("");
+ }
+ else {
+ $(poolTextbox).val("");
+ $(volTextbox).val("");
+ }
+
$.each(types, function(index, elem){
if (selectType == elem.value) {
var buses = new Array();
@@ -74,8 +84,6 @@ kimchi.guest_storage_add_main = function() {
});
}
});
- $(poolTextbox).val('default');
- $(poolTextbox).change();
kimchi.select('guest-add-storage-pool-list', options);
}
});
--
Thanks and best regards!
Sheldon Feng(冯少合)<shaohef(a)linux.vnet.ibm.com>
IBM Linux Technology Center