diff --git a/cps/static/css/style.css b/cps/static/css/style.css index 7a0db2cac..60e1f6dbd 100644 --- a/cps/static/css/style.css +++ b/cps/static/css/style.css @@ -511,16 +511,3 @@ body > div.container-fluid { .input-group .toggle-password { height: 40px; } - -.input-group .toggle-password { - min-width: 40px; - width: 40px; - padding-left: 0; - padding-right: 0; -} - -.input-group .toggle-password .glyphicon { - font-size: 16px; - line-height: 1; - top: 0; -} diff --git a/cps/static/js/main.js b/cps/static/js/main.js index 52fcc1639..7e4c02ca8 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -168,21 +168,23 @@ $("#form-upload-format").uploadprogress({ $(document).on('click', '.toggle-password', function (event) { event.preventDefault(); - var $button = $(this); - var selector = $button.data('target'); - var $passwordInput = $(selector); - if (!$passwordInput.length) { + var button = $(this); + var selector = button.data('target'); + var passwordInput = $(selector); + if (!passwordInput.length) { return; } - var isPassword = $passwordInput.attr('type') === 'password'; - $passwordInput.attr('type', isPassword ? 'text' : 'password'); - var $icon = $button.find('.glyphicon'); - if ($icon.length) { - $icon.toggleClass('glyphicon-eye-open', !isPassword); - $icon.toggleClass('glyphicon-eye-close', isPassword); + var isPassword = passwordInput.attr('type') === 'password'; + passwordInput.attr('type', isPassword ? 'text' : 'password'); + var icon = button.find('.glyphicon'); + if (icon.length) { + icon.toggleClass('glyphicon-eye-open', !isPassword); + icon.toggleClass('glyphicon-eye-close', isPassword); } - var label = isPassword ? _('Hide password') : _('Show password'); - $button.attr({ + var showLabel = button.attr('data-password-show') || button.attr('aria-label') || button.attr('title'); + var hideLabel = button.attr('data-password-hide') || showLabel; + var label = isPassword ? hideLabel : showLabel; + button.attr({ 'aria-label': label, 'title': label }); diff --git a/cps/themes/caliblur/templates/login.html b/cps/themes/caliblur/templates/login.html index dce8c87e9..25204f0ea 100644 --- a/cps/themes/caliblur/templates/login.html +++ b/cps/themes/caliblur/templates/login.html @@ -14,8 +14,8 @@
-
diff --git a/cps/themes/standard/templates/layout.html b/cps/themes/standard/templates/layout.html index c9692f1d5..ba9d2b8f6 100644 --- a/cps/themes/standard/templates/layout.html +++ b/cps/themes/standard/templates/layout.html @@ -111,7 +111,7 @@ {% if current_user.is_authenticated or g.allow_anonymous %}