[FIX] website: submit form

Example where the issue occurs:
- Publish an event
- Go to the website, register for that event
- At confirmation, when the email address is requested, click quickly
  several times on the 'Continue' button

Several registrations are created since nothing prevents multi-clicks.

The stateful button feature of the `button.js` jQuery plugin has been
dropped in Bootstrap 4 (see [1]).

[1] https://getbootstrap.com/docs/4.1/migration/#buttons

opw-1958580

closes odoo/odoo#32571

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-04-15 06:29:05 +00:00
parent b2d2668f85
commit 8906807669
@@ -282,8 +282,8 @@ var WebsiteRoot = BodyManager.extend({
var $buttons = $(ev.currentTarget).find('button[type="submit"], a.a-submit');
_.each($buttons, function (btn) {
var $btn = $(btn);
$btn.attr('data-loading-text', '<i class="fa fa-spinner fa-spin"></i> ' + $(btn).text());
$btn.button('loading');
$btn.html('<i class="fa fa-spinner fa-spin"></i> ' + $btn.text());
$btn.prop('disabled', true);
});
},
/**