[Kimchi-devel] [PATCH] Bug Fix: Correct select menu to handle empty input
huoyuxin at linux.vnet.ibm.com
huoyuxin at linux.vnet.ibm.com
Tue Sep 23 10:48:16 UTC 2014
From: Yu Xin Huo <huoyuxin at linux.vnet.ibm.com>
Signed-off-by: Yu Xin Huo <huoyuxin at linux.vnet.ibm.com>
---
ui/js/widgets/select-menu.js | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/js/widgets/select-menu.js b/ui/js/widgets/select-menu.js
index ad53200..c4b0209 100644
--- a/ui/js/widgets/select-menu.js
+++ b/ui/js/widgets/select-menu.js
@@ -36,8 +36,10 @@
var selectedClass = 'active';
var itemTag = 'li';
var item;
+ that.listControl.find('li').remove();
+ that.label.text("");
+ that.target.val("");
if (options.length > 0) {
- that.listControl.find('li').remove();
$.each(options, function(index, option) {
item = $('<' + itemTag + '>' + option.label +'</' + itemTag + '>');
item.data('value', option.value);
@@ -58,8 +60,6 @@
that.target.change();
}
});
- } else {
- kimchi.message.error.code('KCHAPI6006E');
}
},
--
1.7.1
More information about the Kimchi-devel
mailing list