diff --git a/app/javascript/retrospring/features/settings/password.ts b/app/javascript/retrospring/features/settings/password.ts new file mode 100644 index 00000000..86be08c3 --- /dev/null +++ b/app/javascript/retrospring/features/settings/password.ts @@ -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('#user_current_password').value.length === 0) { + event.preventDefault(); + document.querySelector('[data-target=#modal-passwd]').click(); + } +} \ No newline at end of file