diff options
| author | 2014-06-05 21:56:58 +0200 | |
|---|---|---|
| committer | 2014-06-05 21:56:58 +0200 | |
| commit | 5ea82076faddbdf6b34d20332507779de3c71ae3 (patch) | |
| tree | 88522e933cbd2e06f1639b1687420a8b41409e6f /p/scripts | |
| parent | 92993b26a88f5433fee746c1a6097566b8a3f367 (diff) | |
Improve toggle-password
Add class "active" to button which reveals the password and remove it
when revealing is terminated
Diffstat (limited to 'p/scripts')
| -rw-r--r-- | p/scripts/main.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js index e1a19d6ac..f1dd7117c 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1008,12 +1008,18 @@ function init_feed_observers() { function init_password_observers() { $('input[type="password"] + a.btn.toggle-password').on('click', function(e) { - e.preventDefault(); + var button = $(this); var passwordField = $(this).siblings('input[type="password"]'); + passwordField.attr('type', 'text'); + button.addClass('active'); + setTimeout(function() { passwordField.attr('type', 'password'); + button.removeClass('active'); }, 2000); + + return false; }); } |
