[Kimchi-devel] [PATCH 1/2] bug fix: Enable NFS path field when a NFS server is provided
Daniel H Barboza
danielhb at linux.vnet.ibm.com
Fri Feb 28 19:38:50 UTC 2014
Reviewed-by: Daniel Barboza <danielhb at linux.vnet.ibm.com>
On 02/28/2014 03:00 PM, Aline Manera wrote:
> From: Aline Manera <alinefm at br.ibm.com>
>
> While creating a NFS storage pool, the NFS path field was not editable
> after entering "NFS server IP" the NFS path, unless there was a
> mouse click on other part of the window or use "tab".
>
> It is because .change() has different behaviors according to element
> it is linked.
> The change event is sent to an element when its value changes.
> But for some element types the event is deferred until the element loses
> focus - what was happening with "NFS server IP" field.
>
> So use .keyup() to listen when user types in the field to fix this issue.
> The keyup event is sent to an element when the user releases a key on
> the keyboard.
>
> For reference:
> - http://api.jquery.com/change/
> - http://api.jquery.com/keyup/
>
> Signed-off-by: Aline Manera <alinefm at br.ibm.com>
> ---
> ui/js/src/kimchi.storagepool_add_main.js | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
> index 5960c8d..0cc5349 100644
> --- a/ui/js/src/kimchi.storagepool_add_main.js
> +++ b/ui/js/src/kimchi.storagepool_add_main.js
> @@ -72,7 +72,7 @@ kimchi.initStorageAddPage = function() {
> $('#nfsServerChooseDiv').removeClass('tmpl-html');
> }
> });
> - $('#nfsserverId').on("change",function() {
> + $('#nfsserverId').on("change keyup",function() {
> if ($(this).val() !== '' && kimchi.isServer($(this).val())) {
> $('#nfspathId').prop('disabled',false);
> $(this).removeClass("invalid-field");
More information about the Kimchi-devel
mailing list