mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-02-03 15:11:56 +00:00
add addon to all password fields to make password visible
This commit is contained in:
parent
5db0744bf6
commit
e5724e449a
|
|
@ -1252,12 +1252,12 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
break;
|
||||
default:
|
||||
if(!empty($value['addon']))
|
||||
echo '<div class="input-group date">';
|
||||
echo '<div class="input-group date'.($value["type"]=='password' ? ' show-hide-password' : '').'">';
|
||||
echo '<input'.
|
||||
(!empty($value['type']) ? ' type="'.$value['type'].'"' : '').
|
||||
(!empty($value['id']) ? ' id="'.$value['id'].'"' : '').
|
||||
(!empty($value['name']) ? ' name="'.$value['name'].'"' : '').
|
||||
(empty($value['class']) ? ' class="form-control"' : ' class="form-control '.$value['class'].'"').
|
||||
' class="'.(empty($value['class']) ? 'form-control' : 'form-control '.$value['class']).'"'.
|
||||
((isset($value['value']) && is_string($value['value'])) || !empty($value['value']) ? ' value="'.$value['value'].'"' : '').
|
||||
(!empty($value['placeholder']) ? ' placeholder="'.$value['placeholder'].'"' : '').
|
||||
(!empty($value['autocomplete']) ? ' autocomplete="'.$value['autocomplete'].'"' : '').
|
||||
|
|
|
|||
|
|
@ -403,18 +403,19 @@ $(document).ready( function() {
|
|||
$($(this).data("target")+' .modal-header h3').html($(this).data("modal-title"));
|
||||
}); /* }}} */
|
||||
|
||||
$('body').on('click', '.show-hide-password a', function(ev) { /* {{{ */
|
||||
$('body').on('click', 'div.show-hide-password span', function(ev) { /* {{{ */
|
||||
ev.preventDefault();
|
||||
// console.log($(this).closest('input'));
|
||||
// console.log($(ev.target).parent().parent().children('input'));
|
||||
if($('.show-hide-password input').attr("type") == "text"){
|
||||
$('.show-hide-password input').attr('type', 'password');
|
||||
$('.show-hide-password i').addClass( "fa-eye-slash" );
|
||||
$('.show-hide-password i').removeClass( "fa-eye" );
|
||||
}else if($('.show-hide-password input').attr("type") == "password"){
|
||||
$('.show-hide-password input').attr('type', 'text');
|
||||
$('.show-hide-password i').removeClass( "fa-eye-slash" );
|
||||
$('.show-hide-password i').addClass( "fa-eye" );
|
||||
div = $(this).closest('div.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" );
|
||||
}
|
||||
}); /* }}} */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user