diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-04-26 01:59:20 -0700 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-04-26 01:59:20 -0700 |
commit | 26e2672a5a35b8fa417b7f8650bede78f01b70d7 (patch) | |
tree | 8348303e1cc7e0fda313432b2a18b8088c3c1871 | |
parent | d6978d0c455653370311dc7651a93878442c2498 (diff) | |
parent | 938b12236ad934c9222b9c4fd2d1beaf9a0a4418 (diff) | |
download | nextcloud-server-26e2672a5a35b8fa417b7f8650bede78f01b70d7.tar.gz nextcloud-server-26e2672a5a35b8fa417b7f8650bede78f01b70d7.zip |
Merge pull request #2787 from owncloud/fix-password-autocomplete-2632
turn off autocompletion for password field
-rw-r--r-- | core/js/jquery-showpassword.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/js/jquery-showpassword.js b/core/js/jquery-showpassword.js index 0f4678327a3..e1737643b48 100644 --- a/core/js/jquery-showpassword.js +++ b/core/js/jquery-showpassword.js @@ -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 ); } |