Commit c6ded23e by Dányi Bence

webui: password field visibility toggle

parent 71a17a4c
...@@ -225,3 +225,14 @@ textarea { ...@@ -225,3 +225,14 @@ textarea {
.hilight { .hilight {
background-color: #ff6; background-color: #ff6;
} }
.hidden-password {
padding-right: 25px;
background-image: url(icons/eye-half.png);
background-repeat: no-repeat;
background-position: right center;
cursor: pointer;
&.shown {
background-image: url(icons/eye.png);
}
}
...@@ -142,6 +142,18 @@ $(function() { ...@@ -142,6 +142,18 @@ $(function() {
$('#vm-password-show').click(function(){ $('#vm-password-show').click(function(){
$('#vm-password-show').hide(); $('#vm-password-show').hide();
$('#vm-password').show(); $('#vm-password').show();
});
$('.hidden-password').each(function(){
$(this).val('******');
});
$('.hidden-password').click(function(){
if(!$(this).hasClass('shown')){
$(this).val($(this).data('value'));
$(this).addClass('shown');
} else {
$(this).val('******');
$(this).removeClass('shown');
}
}) })
toggleDetails.apply($('.selected-summary')); toggleDetails.apply($('.selected-summary'));
toggleDetails.apply($('.selected-summary')); toggleDetails.apply($('.selected-summary'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment