[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>
This commit is contained in:
Vincent Schippefilt
2019-03-06 20:07:17 +01:00
committed by Aaron Bohy
co-authored by Aaron Bohy Christophe Matthieu Mathieu Duckerts-Antoine David Monjoie Martin Geubelle svs-odoo
parent a217936144
commit d5a1ff3f64
2 changed files with 7 additions and 7 deletions
@@ -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()
);
]);
}
})
});
@@ -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])