diff options
| author | Christophe Matthieu <chm@odoo.com> | 2019-01-21 12:55:05 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-01-22 17:55:00 +0000 |
| commit | 6521cf4f662a62912b54f52a1236935634913053 (patch) | |
| tree | f1acdcbf7c86b49672a4ac4d5461e9e606b7bb9d /addons/auth_password_policy_signup/static | |
| parent | c0a7c1b1675a0b5fad93c3b8cd519c0e2154227f (diff) | |
[FIX] *: review 'frontend' pages init (web_editor.base)
* auth_password_policy_signup, auth_signup, website, portal, survey,
web_unsplash, website
Following the new editor's merge at https://github.com/odoo/odoo/pull/29775
web_editor.base has been moved to website while it was still used by
frontend pages which do not depend on website (especially portal).
This commit moves web_editor.base to portal while waiting for
https://github.com/odoo/odoo/pull/29442. It also removes the unnecessary
dependencies to it in non-portal pages (in survey for example).
Diffstat (limited to 'addons/auth_password_policy_signup/static')
| -rw-r--r-- | addons/auth_password_policy_signup/static/src/js/signup_policy.js | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/addons/auth_password_policy_signup/static/src/js/signup_policy.js b/addons/auth_password_policy_signup/static/src/js/signup_policy.js index 299db244806..1d37484a34c 100644 --- a/addons/auth_password_policy_signup/static/src/js/signup_policy.js +++ b/addons/auth_password_policy_signup/static/src/js/signup_policy.js @@ -1,25 +1,23 @@ odoo.define('auth_password_policy_signup.policy', function (require) { "use strict"; -var base = require('web_editor.base'); +require('web.dom_ready'); var policy = require('auth_password_policy'); var PasswordMeter = require('auth_password_policy.Meter'); -base.ready().then(function () { - var $signupForm = $('.oe_signup_form, .oe_reset_password_form'); - if (!$signupForm.length) { return; } +var $signupForm = $('.oe_signup_form, .oe_reset_password_form'); +if (!$signupForm.length) { return; } - // hook in password strength meter - // * requirement is the password field's minlength - // * recommendations are from the module - var $password = $signupForm.find('#password'); - var minlength = Number($password.attr('minlength')); - if (isNaN(minlength)) { return; } +// hook in password strength meter +// * requirement is the password field's minlength +// * recommendations are from the module +var $password = $signupForm.find('#password'); +var minlength = Number($password.attr('minlength')); +if (isNaN(minlength)) { return; } - var meter = new PasswordMeter(null, new policy.Policy({minlength: minlength}), policy.recommendations); - meter.insertAfter($password); - $password.on('input', function () { - meter.update($password.val()); - }); +var meter = new PasswordMeter(null, new policy.Policy({minlength: minlength}), policy.recommendations); +meter.insertAfter($password); +$password.on('input', function () { + meter.update($password.val()); }); }); |
