[FIX] auth_signup: properly disable sign up button on click

The feature introduced with https://github.com/odoo/odoo/commit/67d1173bf381befc136d840e232514c2c9ef7e1b
was broken by https://github.com/odoo/odoo/commit/b78b9c87c95acdf6fcf4f4eb3a80efa0e90eae09#diff-2d8ecbf95567bb339109e9552cbc68a3
because a class was removed by mistake.

This commit does not reintroduce the class so that no view is modified
in stable versions but rather review the JS to target the same button
another way.

Bug revealed while working on https://github.com/odoo/odoo/pull/29442

closes odoo/odoo#30896
This commit is contained in:
qsm-odoo
2019-02-06 15:03:04 +00:00
parent fe03f7b6b8
commit 1a299e8833
+5 -3
View File
@@ -6,9 +6,11 @@ var base = require('web_editor.base');
base.ready().then(function() {
// Disable 'Sign Up' button to prevent user form continuous clicking
if ($('.oe_signup_form').length > 0) {
$('.oe_signup_form').on('submit', function () {
$('.o_signup_btn').attr('disabled', 'disabled');
$('.o_signup_btn').prepend('<i class="fa fa-refresh fa-spin"/> ');
$('.oe_signup_form').on('submit', function (ev) {
var $form = $(ev.currentTarget);
var $btn = $form.find('.oe_login_buttons > button[type="submit"]');
$btn.attr('disabled', 'disabled');
$btn.prepend('<i class="fa fa-refresh fa-spin"/> ');
});
}
});