invite: Fix bug when button is not enabled after error in sending invite.
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.

zulip/zulip,kou/zulip,hackerkid/zulip,hackerkid/zulip,zulip/zulip,andersk/zulip,rht/zulip,kou/zulip,punchagan/zulip,rht/zulip,rht/zulip,rht/zulip,kou/zulip,eeshangarg/zulip,punchagan/zulip,eeshangarg/zulip,punchagan/zulip,zulip/zulip,zulip/zulip,zulip/zulip,andersk/zulip,andersk/zulip,kou/zulip,zulip/zulip,hackerkid/zulip,eeshangarg/zulip,hackerkid/zulip,hackerkid/zulip,rht/zulip,punchagan/zulip,eeshangarg/zulip,andersk/zulip,hackerkid/zulip,kou/zulip,kou/zulip,andersk/zulip,zulip/zulip,punchagan/zulip,hackerkid/zulip,eeshangarg/zulip,eeshangarg/zulip,kou/zulip,eeshangarg/zulip,punchagan/zulip,rht/zulip,punchagan/zulip,andersk/zulip,rht/zulip,andersk/zulip