diff options
| author | Vincent Schippefilt <vsc@odoo.com> | 2019-03-06 14:01:55 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2019-03-06 20:07:17 +0100 |
| commit | d5a1ff3f64ec3a5f446f5ae5283526e32c3fc413 (patch) | |
| tree | 232138553198f25b42ea6d41389b4ec6f8f7b88b /addons/auth_password_policy/static/src | |
| parent | a217936144d06ebd095ef1737008f2ff25170da5 (diff) | |
[REF] auth_password_policy: adapt code after jQuery update
Part of task 1896658
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
Diffstat (limited to 'addons/auth_password_policy/static/src')
| -rw-r--r-- | addons/auth_password_policy/static/src/js/change_password.js | 8 | ||||
| -rw-r--r-- | addons/auth_password_policy/static/src/js/password_field.js | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/addons/auth_password_policy/static/src/js/change_password.js b/addons/auth_password_policy/static/src/js/change_password.js index 1a6e7faaafc..0a40f4bd39d 100644 --- a/addons/auth_password_policy/static/src/js/change_password.js +++ b/addons/auth_password_policy/static/src/js/change_password.js @@ -18,16 +18,16 @@ ChangePassword.include({ }).then(function (p) { _this._meter = new Meter(_this, new policy.Policy(p), policy.recommendations); }); - return $.when( + return Promise.all([ this._super.apply(this, arguments), getPolicy - ); + ]); }, start: function () { - return $.when( + return Promise.all([ this._meter.insertAfter(this.$('input[name=new_password]')), this._super() - ); + ]); } }) }); diff --git a/addons/auth_password_policy/static/src/js/password_field.js b/addons/auth_password_policy/static/src/js/password_field.js index fa8cfd20ff2..f0aa2c4420e 100644 --- a/addons/auth_password_policy/static/src/js/password_field.js +++ b/addons/auth_password_policy/static/src/js/password_field.js @@ -28,10 +28,10 @@ var PasswordField = fields.InputField.extend({ }).then(function (p) { _this._meter = new Meter(_this, new policy.Policy(p), policy.recommendations); }); - return $.when( + return Promise.all([ this._super.apply(this, arguments), getPolicy - ); + ]); }, /** * Add a <meter> next to the input (TODO: move to template?) @@ -42,7 +42,7 @@ var PasswordField = fields.InputField.extend({ _renderEdit: function () { var _this = this; var meter = this._meter; - return $.when(this._super.apply(this, arguments)).then(function () { + return Promise.resolve(this._super.apply(this, arguments)).then(function () { return meter._widgetRenderAndInsert(function (t) { // insertAfter doesn't work and appendTo means the meter is // ignored (as this.$el is an input[type=password]) |
