From 890680766921fa9d9efdf7098917155da3ec7f23 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 10 Apr 2019 07:31:07 +0000 Subject: [PATCH] [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) --- addons/website/static/src/js/content/website_root.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/static/src/js/content/website_root.js b/addons/website/static/src/js/content/website_root.js index cf4812b28b9..ee94f0e8a82 100644 --- a/addons/website/static/src/js/content/website_root.js +++ b/addons/website/static/src/js/content/website_root.js @@ -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', ' ' + $(btn).text()); - $btn.button('loading'); + $btn.html(' ' + $btn.text()); + $btn.prop('disabled', true); }); }, /**