[PATCH] Issue #473: Update selectMenu method to set a default value.

On all pages with selectMenu (combobox) the user had to choose an option to effectively store its value in the form. This patch updates the function to use the first option as default value. With this patch, user can skip the combo selection if want use the first option. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- ui/js/widgets/select-menu.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/js/widgets/select-menu.js b/ui/js/widgets/select-menu.js index c4b0209..4a79605 100644 --- a/ui/js/widgets/select-menu.js +++ b/ui/js/widgets/select-menu.js @@ -46,6 +46,7 @@ if(option.value === value) { item.addClass(selectedClass); that.label.text(option.label); + that.target.val(option.value); } that.listControl.append(item); }); -- 1.9.3

Reviewed-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> Tested-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> On 11/11/2014 03:47 PM, Paulo Vital wrote:
On all pages with selectMenu (combobox) the user had to choose an option to effectively store its value in the form.
This patch updates the function to use the first option as default value. With this patch, user can skip the combo selection if want use the first option.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- ui/js/widgets/select-menu.js | 1 + 1 file changed, 1 insertion(+)
diff --git a/ui/js/widgets/select-menu.js b/ui/js/widgets/select-menu.js index c4b0209..4a79605 100644 --- a/ui/js/widgets/select-menu.js +++ b/ui/js/widgets/select-menu.js @@ -46,6 +46,7 @@ if(option.value === value) { item.addClass(selectedClass); that.label.text(option.label); + that.target.val(option.value); } that.listControl.append(item); });

Applied. Thanks. Regards, Aline Manera
participants (3)
-
Aline Manera
-
Paulo Vital
-
Rodrigo Trujillo