diff options
| author | qsm-odoo <qsm@odoo.com> | 2019-02-06 14:29:07 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-02-26 17:09:22 +0000 |
| commit | 27fca749af30d7dce448f6632132422df8d8a7c1 (patch) | |
| tree | c644db5efbb12cde722d059d250a83ec0de8aed7 /addons/auth_signup/static | |
| parent | c3da83b40a6431f607cf69b8c2a7a922a6e5b52c (diff) | |
[REF] *: use 'frontend' system in non-website apps
* account, auth_signup, payment, portal, project, sale, sale_management,
web_unsplash, website, website_mail, website_rating, website_sale
This commit does probably not do what is stated for all non-website apps
but it is a first step. It also uses the system in apps which could have
already used it but did not.
Part of https://github.com/odoo/odoo/pull/29442
task-1932066
Diffstat (limited to 'addons/auth_signup/static')
| -rw-r--r-- | addons/auth_signup/static/src/js/signup.js | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/addons/auth_signup/static/src/js/signup.js b/addons/auth_signup/static/src/js/signup.js index 567b2d612f1..366d4cef124 100644 --- a/addons/auth_signup/static/src/js/signup.js +++ b/addons/auth_signup/static/src/js/signup.js @@ -1,16 +1,25 @@ odoo.define('auth_signup.signup', function (require) { - 'use strict'; +'use strict'; -require('web.dom_ready'); +var publicWidget = require('web.public.widget'); -// Disable 'Sign Up' button to prevent user form continuous clicking -if ($('.oe_signup_form').length > 0) { - $('.oe_signup_form').on('submit', function (ev) { - var $form = $(ev.currentTarget); - var $btn = $form.find('.oe_login_buttons > button[type="submit"]'); +publicWidget.registry.SignUpForm = publicWidget.Widget.extend({ + selector: '.oe_signup_form', + events: { + 'submit': '_onSubmit', + }, + + //-------------------------------------------------------------------------- + // Handlers + //-------------------------------------------------------------------------- + + /** + * @private + */ + _onSubmit: function () { + var $btn = this.$('.oe_login_buttons > button[type="submit"]'); $btn.attr('disabled', 'disabled'); $btn.prepend('<i class="fa fa-refresh fa-spin"/> '); - }); -} - + }, +}); }); |
