aboutsummaryrefslogtreecommitdiff
path: root/app/install.php
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 /app/install.php
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 'app/install.php')
-rw-r--r--app/install.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/app/install.php b/app/install.php
index a79b0d318..eb2f764f9 100644
--- a/app/install.php
+++ b/app/install.php
@@ -611,23 +611,26 @@ function printStep2() {
</div>
<script>
- function toggle_password() {
+ function show_password() {
var button = this;
var passwordField = document.getElementById(button.getAttribute('data-toggle'));
-
passwordField.setAttribute('type', 'text');
button.className += ' active';
- setTimeout(function() {
- passwordField.setAttribute('type', 'password');
- button.className = button.className.replace(/(?:^|\s)active(?!\S)/g , '');
- }, 2000);
+ return false;
+ }
+ function hide_password() {
+ var button = this;
+ var passwordField = document.getElementById(button.getAttribute('data-toggle'));
+ passwordField.setAttribute('type', 'password');
+ button.className = button.className.replace(/(?:^|\s)active(?!\S)/g , '');
return false;
}
toggles = document.getElementsByClassName('toggle-password');
for (var i = 0 ; i < toggles.length ; i++) {
- toggles[i].addEventListener('click', toggle_password);
+ toggles[i].addEventListener('mousedown', show_password);
+ toggles[i].addEventListener('mouseup', hide_password);
}
function auth_type_change(focus) {