summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-11 01:18:40 -0700
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-11 01:18:40 -0700
commit18c873d1e5746bd0e032c9c6e402da487fa9634a (patch)
treedc2bd8655b8950a0a9c199d6f0a2ead81fc1f5d1 /core/js
parentb02db643d08fde6bf609e9e2e31c32b4a16518c4 (diff)
parent3d008b2ff34c844521a9dcea387642cee4290b6f (diff)
downloadnextcloud-server-18c873d1e5746bd0e032c9c6e402da487fa9634a.tar.gz
nextcloud-server-18c873d1e5746bd0e032c9c6e402da487fa9634a.zip
Merge pull request #2554 from owncloud/hide-toggle-checkbox
Implements Hide / Display for the Password Toggle Button
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/core/js/js.js b/core/js/js.js
index e1fbd04a8da..1bb546f7081 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -591,10 +591,20 @@ $(document).ready(function(){
}
});
- // 'show password' checkbox
- $('#password').showPassword();
- $('#adminpass').showPassword();
- $('#pass2').showPassword();
+ var setShowPassword = function(input, label) {
+ input.showPassword().keyup(function(){
+ if (input.val().length == 0) {
+ label.hide();
+ }
+ else {
+ label.css("display", "inline").show();
+ }
+ });
+ label.hide();
+ };
+ setShowPassword($('#password'), $('label[for=show]'));
+ setShowPassword($('#adminpass'), $('label[for=show]'));
+ setShowPassword($('#pass2'), $('label[for=personal-show]'));
//use infield labels
$("label.infield").inFieldLabels({