mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-01-14 13:27:28 +00:00
add button to password fields for toggling visibility
This commit is contained in:
parent
62145c2f4e
commit
ac22269120
|
|
@ -1269,7 +1269,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
break;
|
||||
default:
|
||||
if(!empty($value['addon']))
|
||||
echo "<span class=\"input-append\">";
|
||||
echo '<span class="input-append'.($value["type"]=='password' ? ' show-hide-password' : '').'">';
|
||||
echo '<input'.
|
||||
(!empty($value['type']) ? ' type="'.$value['type'].'"' : '').
|
||||
(!empty($value['id']) ? ' id="'.$value['id'].'"' : '').
|
||||
|
|
|
|||
|
|
@ -369,6 +369,22 @@ $(document).ready( function() {
|
|||
$($(this).data("target")+' .modal-header h3').html($(this).data("modal-title"));
|
||||
}); /* }}} */
|
||||
|
||||
$('body').on('click', 'span.show-hide-password span', function(ev) { /* {{{ */
|
||||
ev.preventDefault();
|
||||
div = $(this).closest('span.show-hide-password');
|
||||
icon = $(this).children(":first");
|
||||
input = div.children(":first");
|
||||
if (input.attr("type") == "text") {
|
||||
input.attr('type', 'password');
|
||||
icon.addClass( "fa-eye-slash" );
|
||||
icon.removeClass( "fa-eye" );
|
||||
} else if (input.attr("type") == "password") {
|
||||
input.attr('type', 'text');
|
||||
icon.removeClass( "fa-eye-slash" );
|
||||
icon.addClass( "fa-eye" );
|
||||
}
|
||||
}); /* }}} */
|
||||
|
||||
$('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });
|
||||
|
||||
initMost();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user