fix password for user
This commit is contained in:
@@ -33,12 +33,16 @@ Espo.define('Views.Fields.Password', 'Views.Fields.Base', function (Dep) {
|
||||
|
||||
events: {
|
||||
'click [data-action="change"]': function (e) {
|
||||
$(e.currentTarget).addClass('hidden');
|
||||
this.$element.removeClass('hidden');
|
||||
this.changing = true;
|
||||
this.changePassword();
|
||||
},
|
||||
},
|
||||
|
||||
changePassword: function () {
|
||||
this.$el.find('[data-action="change"]').addClass('hidden');
|
||||
this.$element.removeClass('hidden');
|
||||
this.changing = true;
|
||||
},
|
||||
|
||||
data: function () {
|
||||
return _.extend({
|
||||
isNew: this.model.isNew(),
|
||||
@@ -57,7 +61,12 @@ Espo.define('Views.Fields.Password', 'Views.Fields.Base', function (Dep) {
|
||||
|
||||
afterRender: function () {
|
||||
Dep.prototype.afterRender.call(this);
|
||||
|
||||
this.changing = false;
|
||||
|
||||
if (this.params.readyToChange) {
|
||||
this.changePassword();
|
||||
}
|
||||
},
|
||||
|
||||
fetch: function () {
|
||||
|
||||
@@ -50,14 +50,16 @@ Espo.define('Views.User.Record.Edit', 'Views.Record.Edit', function (Dep) {
|
||||
name: 'password',
|
||||
type: 'password',
|
||||
params: {
|
||||
required: self.isNew
|
||||
required: self.isNew,
|
||||
readyToChange: true
|
||||
}
|
||||
}],
|
||||
[{
|
||||
name: 'passwordConfirm',
|
||||
type: 'password',
|
||||
params: {
|
||||
required: self.isNew
|
||||
required: self.isNew,
|
||||
readyToChange: true
|
||||
}
|
||||
}]
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user