]> source.dussan.org Git - nextcloud-server.git/commitdiff
modify password clone to password type right on submit to prevent the browser remind...
authorMorris Jobke <morris.jobke@gmail.com>
Fri, 19 Apr 2013 08:06:18 +0000 (10:06 +0200)
committerMorris Jobke <morris.jobke@gmail.com>
Fri, 19 Apr 2013 08:06:18 +0000 (10:06 +0200)
core/js/jquery-showpassword.js

index 9cdc48efe89cc333bb3792a8edc90d4545c81aa2..e1737643b484e3055fc90ce42119658f006d12ca 100644 (file)
                                $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 );
                                }