diff options
author | raghunayyar <me@iraghu.com> | 2013-03-25 04:30:09 +0530 |
---|---|---|
committer | raghunayyar <me@iraghu.com> | 2013-03-25 04:30:09 +0530 |
commit | d9cd9875e0be3fbadb57d562724f509de9611ab7 (patch) | |
tree | bd6d92458fa10acab83e41e2a3f7f15e5a665f89 /core/js | |
parent | 0e55b611693ffa2171844a476573ebfc211b35e8 (diff) | |
download | nextcloud-server-d9cd9875e0be3fbadb57d562724f509de9611ab7.tar.gz nextcloud-server-d9cd9875e0be3fbadb57d562724f509de9611ab7.zip |
Initial Commit : Password Toggle Button hides if no input present
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/js.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/core/js/js.js b/core/js/js.js index b237c6fcf5b..93d4c0a03e5 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -638,9 +638,21 @@ $(document).ready(function(){ }); // 'show password' checkbox - $('#password').showPassword(); - $('#adminpass').showPassword(); - $('#pass2').showPassword(); + + var hideToggleBtn = 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(); + }; + hideToggleBtn($('#password'), $('label[for=show]')); + hideToggleBtn($('#adminpass'), $('label[for=show]')); + hideToggleBtn($('#pass2'), $('label[for=personal-show]')); //use infield labels $("label.infield").inFieldLabels({ |