Etemplate: Password widget now auto-updates the second 'confirm' password if you have two and suggest a password.

This commit is contained in:
nathangray 2020-07-23 13:56:14 -06:00
parent 6d2af76576
commit b6e47f9b11
4 changed files with 16 additions and 21 deletions

View File

@ -906,16 +906,6 @@ var AddressbookApp = /** @class */ (function (_super) {
AddressbookApp.prototype.account_change = function (_ev, _widget) {
switch (_widget.id) {
case 'account_passwd':
debugger;
// If they clicked suggest, copy it to password 2
if (_widget && _widget.options.viewable) {
var p2 = _widget.getParent().getWidgetById('account_passwd_2');
p2.set_viewable(true); // Allow viewing password
p2.toggle_visibility(true); // Actually show it
p2.set_value(_widget.getValue());
_widget.options.viewable = false;
}
// Fall through
case 'account_lid':
case 'n_family':
case 'n_given':

View File

@ -1102,17 +1102,6 @@ class AddressbookApp extends EgwApp
switch(_widget.id)
{
case 'account_passwd':
debugger;
// If they clicked suggest, copy it to password 2
if(_widget && _widget.options.viewable)
{
let p2 = _widget.getParent().getWidgetById('account_passwd_2');
p2.set_viewable(true); // Allow viewing password
p2.toggle_visibility(true); // Actually show it
p2.set_value(_widget.getValue());
_widget.options.viewable = false;
}
// Fall through
case 'account_lid':
case 'n_family':
case 'n_given':

View File

@ -221,6 +221,13 @@ var et2_password = /** @class */ (function (_super) {
this.encrypted = false;
this.input.val(suggestion);
this.input.trigger('change');
// Check for second password, update it too
var two = this.getParent().getWidgetById(this.id + '_2');
if (two && two.getType() == this.getType()) {
two.options.viewable = true;
two.toggle_visibility(true);
two.set_value(suggestion);
}
}, this, true, this).sendRequest();
};
et2_password.prototype.destroy = function () {

View File

@ -300,6 +300,15 @@ export class et2_password extends et2_textbox
this.encrypted = false;
this.input.val(suggestion);
this.input.trigger('change');
// Check for second password, update it too
let two = this.getParent().getWidgetById(this.id+'_2');
if(two && two.getType() == this.getType())
{
two.options.viewable = true;
two.toggle_visibility(true);
two.set_value(suggestion);
}
},
this,true,this
).sendRequest();