mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-10 11:32:07 -05:00
97abde3992
[web] Website redesign for log in page GitOrigin-RevId: 2f700ca7cec242598449b1f4fc830801976b9eaf
28 lines
976 B
JavaScript
28 lines
976 B
JavaScript
const visibilityOnQuery = '[data-ol-password-visibility-toggle="visibilityOn"]'
|
|
const visibilityOffQuery =
|
|
'[data-ol-password-visibility-toggle="visibilityOff"]'
|
|
|
|
const visibilityOnButton = document.querySelector(visibilityOnQuery)
|
|
const visibilityOffButton = document.querySelector(visibilityOffQuery)
|
|
|
|
if (visibilityOffButton && visibilityOnButton) {
|
|
visibilityOnButton.addEventListener('click', function () {
|
|
const passwordInput = document.querySelector(
|
|
'[data-ol-password-visibility-target]'
|
|
)
|
|
passwordInput.type = 'text'
|
|
visibilityOnButton.hidden = true
|
|
visibilityOffButton.hidden = false
|
|
visibilityOffButton.focus()
|
|
})
|
|
|
|
visibilityOffButton.addEventListener('click', function () {
|
|
const passwordInput = document.querySelector(
|
|
'[data-ol-password-visibility-target]'
|
|
)
|
|
passwordInput.type = 'password'
|
|
visibilityOffButton.hidden = true
|
|
visibilityOnButton.hidden = false
|
|
visibilityOnButton.focus()
|
|
})
|
|
}
|