Merge pull request #2787 from owncloud/fix-password-autocomplete-2632
turn off autocompletion for password field
This commit is contained in:
commit
26e2672a5a
1 changed files with 12 additions and 2 deletions
14
core/js/jquery-showpassword.js
vendored
14
core/js/jquery-showpassword.js
vendored
|
@ -35,7 +35,8 @@
|
|||
'style' : $element.attr('style'),
|
||||
'size' : $element.attr('size'),
|
||||
'name' : $element.attr('name')+'-clone',
|
||||
'tabindex' : $element.attr('tabindex')
|
||||
'tabindex' : $element.attr('tabindex'),
|
||||
'autocomplete' : 'off'
|
||||
});
|
||||
|
||||
return $clone;
|
||||
|
@ -102,7 +103,16 @@
|
|||
$clone.bind('blur', function() { $input.trigger('focusout'); });
|
||||
|
||||
setState( $checkbox, $input, $clone );
|
||||
|
||||
|
||||
// set type of password field clone (type=text) to password right on submit
|
||||
// to prevent browser save the value of this field
|
||||
$clone.closest('form').submit(function(e) {
|
||||
// .prop has to be used, because .attr throws
|
||||
// an error while changing a type of an input
|
||||
// element
|
||||
$clone.prop('type', 'password');
|
||||
});
|
||||
|
||||
if( callback.fn ){
|
||||
callback.fn( callback.args );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue