diff --git a/assets/controllers/password_reveal_controller.js b/assets/controllers/password_reveal_controller.js new file mode 100644 index 0000000..547ece4 --- /dev/null +++ b/assets/controllers/password_reveal_controller.js @@ -0,0 +1,11 @@ +import { Controller } from '@hotwired/stimulus' + +export default class extends Controller { + + static targets = [ 'field' ] + + toggle() { + let type = this.fieldTarget.getAttribute('type') === 'password' ? 'text' : 'password' + this.fieldTarget.setAttribute('type', type) + } +} diff --git a/templates/booking/create/authenticate.html.twig b/templates/booking/create/authenticate.html.twig index ed05a18..072a91b 100644 --- a/templates/booking/create/authenticate.html.twig +++ b/templates/booking/create/authenticate.html.twig @@ -59,16 +59,24 @@ autocomplete="username"> -