mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 14:11:10 +00:00
Add button to show and hide password in the devise registrations form
Makes it easy for a user to check that he have typed the password correctly.
This commit is contained in:
parent
6e276b2787
commit
1ff30d155d
4 changed files with 30 additions and 2 deletions
|
|
@ -39,6 +39,7 @@
|
|||
//= require osem-bootstrap
|
||||
//= require osem-revisionhistory
|
||||
//= require osem-commercials
|
||||
//= require osem-register
|
||||
//= require unobtrusive_flash
|
||||
//= require unobtrusive_flash_bootstrap
|
||||
//= require countable
|
||||
|
|
|
|||
15
app/assets/javascripts/osem-register.js
Normal file
15
app/assets/javascripts/osem-register.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
$( document ).ready(function() {
|
||||
|
||||
$('.osem-register button.show-or-hide-password').click(function() {
|
||||
const is_locked = $(this).data('lock');
|
||||
$(this).data('lock', !is_locked);
|
||||
$(this).parents('.osem-register').find('input').attr('type', is_locked ? 'text' : 'password');
|
||||
if (is_locked) {
|
||||
$(this).find('.show-password').hide();
|
||||
$(this).find('.hide-password').show();
|
||||
} else {
|
||||
$(this).find('.show-password').show();
|
||||
$(this).find('.hide-password').hide();
|
||||
}
|
||||
} );
|
||||
} );
|
||||
Loading…
Add table
Add a link
Reference in a new issue