[Kimchi-devel] [PATCH] [Kimchi] Issue# 317 Inconsistent button status when adding or creating new resources
Daniel Henrique Barboza
dhbarboza82 at gmail.com
Tue Aug 16 12:59:08 UTC 2016
Applied to master. Thanks!
On 08/15/2016 08:53 PM, 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>
More information about the Kimchi-devel
mailing list