From 2d1cb016abb1ad2e5c9a875c649a702480f97b1b Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 13 Jan 2015 11:16:13 +0100 Subject: Fix user interaction with showing password feature Before, the password was hidden again after 2 seconds. Now, the password is hidden when the mouse is released Fix https://github.com/FreshRSS/FreshRSS/issues/734 --- p/scripts/main.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'p/scripts') diff --git a/p/scripts/main.js b/p/scripts/main.js index e8bd66fc1..9b6524b01 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1134,17 +1134,18 @@ function init_feed_observers() { } function init_password_observers() { - $('input[type="password"] + a.btn.toggle-password').on('click', function(e) { + $('.toggle-password').on('mousedown', function(e) { var button = $(this); - var passwordField = $(this).siblings('input[type="password"]'); - + var passwordField = $('#' + button.attr('data-toggle')); passwordField.attr('type', 'text'); button.addClass('active'); - setTimeout(function() { - passwordField.attr('type', 'password'); - button.removeClass('active'); - }, 2000); + return false; + }).on('mouseup', function(e) { + var button = $(this); + var passwordField = $('#' + button.attr('data-toggle')); + passwordField.attr('type', 'password'); + button.removeClass('active'); return false; }); -- cgit v1.2.3