[Kimchi-devel] [PATCH] [Kimchi] Issue# 317 Inconsistent button status when adding or creating new resources

joserz at linux.vnet.ibm.com joserz at linux.vnet.ibm.com
Tue Aug 16 03:07:31 UTC 2016


Reviewed-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
On Mon, Aug 15, 2016 at 04:53:37PM -0700, Socorro Stoppler wrote:
> From: Socorro <socorro at linux.vnet.ibm.com>
> 
> - Addressed last comment by pvital in github issue in that only the Network tab
>   now has this problem in that the 'Create' button is enabled after clicking on
>   Add a Newtwork. It should be disabled by default until the minimum of the required 
>   fields are filled.  In the Network case, network name field (as long as valid)
>   will enable the Create button as soon as at least one character is typed in.
> 
> Signed-off-by: Socorro <socorro at linux.vnet.ibm.com>
> ---
>  ui/js/src/kimchi.network_add_main.js | 6 +++---
>  ui/pages/network-add.html.tmpl       | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/ui/js/src/kimchi.network_add_main.js b/ui/js/src/kimchi.network_add_main.js
> index fd45f34..e1fdf13 100644
> --- a/ui/js/src/kimchi.network_add_main.js
> +++ b/ui/js/src/kimchi.network_add_main.js
> @@ -153,9 +153,9 @@ kimchi.changeNetworkDestination = function() {
> 
>  kimchi.updateNetworkFormButton = function() {
>      if($("#networkName").hasClass("invalid-field")){
> -        $("#networkFormOk").button("disable");
> -    }else{
> -        $("#networkFormOk").button("enable");
> +        $("#networkFormOk").attr('disabled', true);
> +    } else{
> +        $("#networkFormOk").attr('disabled', false);
>      }
>  };
> 
> diff --git a/ui/pages/network-add.html.tmpl b/ui/pages/network-add.html.tmpl
> index fbbea3d..14373ff 100644
> --- a/ui/pages/network-add.html.tmpl
> +++ b/ui/pages/network-add.html.tmpl
> @@ -66,7 +66,7 @@
>          </div>
>      </div>
>      <div class="modal-footer">
> -        <button type="submit" id="networkFormOk" class="btn btn-default">$_("Create")</button>
> +        <button type="submit" id="networkFormOk" class="btn btn-default" disabled="disabled">$_("Create")</button>
>          <button type="button" id="networkFormCancel" data-dismiss="modal" class="btn btn-default">$_("Cancel")</button>
>      </div>
>  </div>
> -- 
> 2.7.4
> 
> _______________________________________________
> Kimchi-devel mailing list
> Kimchi-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
> 




More information about the Kimchi-devel mailing list