Improve password prompt UI

pull/1/head
yflory 5 years ago
parent c9c19b8395
commit 2fd31e8d89

@ -9,8 +9,27 @@
flex: 1;
min-width: 0;
}
label, .fa {
margin-left: 10px;
.fa {
width: 30px;
height: 30px;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
&:hover {
background-color: rgba(0,0,0,0.1);
}
}
}
.cp-password-change-container {
display: flex;
align-items: center;
.cp-password-container {
margin-bottom: 0 !important;
flex: 1;
}
button {
margin: 0 !important;
}
}
}

@ -590,9 +590,10 @@ define([
}, opts);
var input = h('input.cp-password-input', attributes);
var reveal = UI.createCheckbox('cp-password-reveal', Messages.password_show);
//var reveal = UI.createCheckbox('cp-password-reveal', Messages.password_show);
var eye = h('span.fa.fa-eye.cp-password-reveal');
/*
$(reveal).find('input').on('change', function () {
if($(this).is(':checked')) {
$(input).prop('type', 'text');
@ -602,7 +603,9 @@ define([
$(input).prop('type', 'password');
$(input).focus();
});
*/
if (displayEye) {
$(eye).mousedown(function () {
$(input).prop('type', 'text');
$(input).focus();
@ -613,15 +616,28 @@ define([
$(input).prop('type', 'password');
$(input).focus();
});
if (displayEye) {
} else {
$(eye).click(function () {
if ($(this).hasClass('fa-eye')) {
$(input).prop('type', 'text');
$(input).focus();
$(this).removeClass('fa-eye').addClass('fa-eye-slash');
return;
}
$(input).prop('type', 'password');
$(input).focus();
$(this).removeClass('fa-eye-slash').addClass('fa-eye');
});
}
/*if (displayEye) {
$(reveal).hide();
} else {
$(eye).hide();
}
}*/
return h('span.cp-password-container', [
input,
reveal,
//reveal,
eye
]);
};

@ -570,7 +570,7 @@ define([
style: 'flex: 1;'
});
var passwordOk = h('button', Messages.properties_changePasswordButton);
var changePass = h('span.cp-password-container', [
var changePass = h('span.cp-password-change-container', [
newPassword,
passwordOk
]);

Loading…
Cancel
Save