Port password confirmation functionality to TypeScript

This commit is contained in:
Andreas Nedbal 2022-01-06 02:55:12 +01:00
parent 9b6abb9148
commit b18c68449e
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
/*
# see GitHub issue #11
($ document).on "submit", "form#edit_user", (evt) ->
if ($ "input#user_current_password").val().length == 0
evt.preventDefault()
$("button[data-target=#modal-passwd]").trigger 'click'
*/
export function userSubmitHandler(event: Event): void {
if (document.querySelector<HTMLInputElement>('#user_current_password').value.length === 0) {
event.preventDefault();
document.querySelector<HTMLButtonElement>('[data-target=#modal-passwd]').click();
}
}