aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-13 11:16:13 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-13 11:16:13 +0100
commit2d1cb016abb1ad2e5c9a875c649a702480f97b1b (patch)
treefa576bd715779b07b55b67054046fec3e4d69763 /p/scripts
parent2628197190e98cbb27db75bc603b88f51869f8db (diff)
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
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js15
1 files changed, 8 insertions, 7 deletions
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;
});