mirror of https://github.com/zulip/zulip.git
invite: Fix bug when button is not enabled after error in sending invite.
There is a bug where invite button is not enabled again after sending invite is failed, but it is enabled on successful completion of invite. I am not able to figure out why it is behaving differently in success and error cases, even when the code to enable button is in complete() function and it is called in both the cases. But, I can confirm that adding .button('reset') fixes this bug as button is disabled using the .button('loading') call and this is according to the bootstrap docs only. But the bootstrap docs mention that the .button(string) method has been removed in v4.0 as mentioned here https://getbootstrap.com/docs/3.4/javascript/. So, as we would want to avoid using depereceated or removed methods, this commit simply changes the code to disable the button and set the loading text using simple jquery and this also solves the above mentioned bug.
This commit is contained in:
parent
d9fc424e12
commit
04a856fa5b
|
@ -50,7 +50,9 @@ function beforeSend() {
|
|||
// aren't in the right domain, etc.)
|
||||
//
|
||||
// OR, you could just let the server do it. Probably my temptation.
|
||||
$("#submit-invitation").button("loading");
|
||||
const loading_text = $("#submit-invitation").data("loading-text");
|
||||
$("#submit-invitation").text(loading_text);
|
||||
$("#submit-invitation").prop("disabled", true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue