[Kimchi-devel] [PATCH 1/2] bug fix: Enable NFS path field when a NFS server is provided

Paulo Ricardo Paz Vital pvital at linux.vnet.ibm.com
Fri Feb 28 18:58:37 UTC 2014


-- 
Tested-by: Paulo Vital <pvital at linux.vnet.ibm.com>
Reviewed-by: Paulo Vital <pvital at linux.vnet.ibm.com>


On Fri, 2014-02-28 at 15:00 -0300, 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