]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixes autofill for display / hide toggle button, a better function name.
authorraghunayyar <me@iraghu.com>
Mon, 25 Mar 2013 10:39:35 +0000 (16:09 +0530)
committerraghunayyar <me@iraghu.com>
Mon, 25 Mar 2013 10:39:35 +0000 (16:09 +0530)
core/js/js.js

index 93d4c0a03e5bcaa341fa0b072ed4619603f53e51..3f1934241fbcd7b09b4ba39da21112f33195a742 100644 (file)
@@ -637,22 +637,23 @@ $(document).ready(function(){
                }
        });
 
-       // 'show password' checkbox
-       
-       var hideToggleBtn = function(input, label) {
+       var setShowPassword = function(input, label) {
                // 'show password' checkbox
-               input.showPassword().keyup(function(){
-                       if (input.val().length == 0) {
-                               label.hide();
-                       } else {
-                               label.css("display", "inline").show();
-                       }
-               });
-               label.hide();
+                       setTimeout(function() {
+                               input.showPassword().keyup(function(){
+                                       if (input.val().length == 0) {
+                                               label.hide();
+                                       }
+                                       else {
+                                               label.css("display", "inline").show();
+                                       }
+                               });
+                       },200);
+                       label.hide();
        };
-       hideToggleBtn($('#password'), $('label[for=show]'));
-       hideToggleBtn($('#adminpass'), $('label[for=show]'));
-       hideToggleBtn($('#pass2'), $('label[for=personal-show]'));
+       setShowPassword($('#password'), $('label[for=show]'));
+       setShowPassword($('#adminpass'), $('label[for=show]'));
+       setShowPassword($('#pass2'), $('label[for=personal-show]'));
 
        //use infield labels
        $("label.infield").inFieldLabels({