Don't show the password field in the modal if no password

pull/1/head
yflory 4 years ago
parent bb2299376f
commit 1f16b525d3

@ -814,19 +814,29 @@ define([
]));
}
var hasPassword = data.password;
if (hasPassword) {
$('<label>', {'for': 'cp-app-prop-password'}).text(Messages.creation_passwordValue).appendTo($d);
var password = UI.passwordInput({
id: 'cp-app-prop-password',
readonly: 'readonly'
});
$d.append(password);
if (!data.noPassword) {
var hasPassword = data.password;
var $password = $(password);
var $pwInput = $password.find('.cp-password-input');
var $pwInput = $(password).find('.cp-password-input');
$pwInput.val(data.password || '').click(function () {
$pwInput[0].select();
});
} else {
/*
// XXX don't show the "current password" field if there is no password?
Messages.noPassword = "No password";
$d.append(h('div.cp-app-prop', [
Messages.creation_passwordValue,
h('br'),
h('span.cp-app-prop-content', Messages.noPassword)
]));
*/
}
// In the properties, we should have the edit href if we know it.
// We should know it because the pad is stored, but it's better to check...
@ -938,7 +948,6 @@ define([
});
$d.append(changePass);
}
}
if (owned) {
var deleteOwned = h('button.btn.btn-danger-alt', [h('i.cptools.cptools-destroy'), Messages.fc_delete_owned]);
var spinner = UI.makeSpinner();

Loading…
Cancel
Save