mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 13:11:15 -07:00
Reveal token input fields if blank
This commit is contained in:
parent
74b4e45915
commit
40e0db4f70
5 changed files with 31 additions and 10 deletions
|
@ -891,3 +891,23 @@ function loadBlurHash(elem, src) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
function _toggleRevealToken(elem, click) {
|
||||
var input = elem.parent().next('input');
|
||||
if ((input.prop('type') === 'password' && click) || !input.val()) {
|
||||
input.prop('type', 'text');
|
||||
elem.children('.fa').removeClass('fa-eye-slash').addClass('fa-eye');
|
||||
} else {
|
||||
input.prop('type', 'password');
|
||||
elem.children('.fa').removeClass('fa-eye').addClass('fa-eye-slash');
|
||||
}
|
||||
}
|
||||
function toggleRevealTokens() {
|
||||
$('.reveal-token').each(function () {
|
||||
_toggleRevealToken($(this));
|
||||
});
|
||||
}
|
||||
|
||||
$('body').on('click', '.reveal-token', function() {
|
||||
_toggleRevealToken($(this), true);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue