portico-signup: Strip whitespace from email fields.

This strips out whitespace from the email fields on the register
and login screens.

Fixes: #6578.
This commit is contained in:
YJDave 2017-09-27 23:47:15 +05:30 committed by Tim Abbott
parent 9187acfb8c
commit e3917b7d63
1 changed files with 8 additions and 0 deletions

View File

@ -60,4 +60,12 @@ $(function () {
errorClass: "text-error",
wrapper: "div",
});
$(".register-page #email, .login-page-container #id_username").on('focusout keydown', function (e) {
// check if it is the "focusout" or if it is a keydown, then check if
// the keycode was the one for "enter" (13).
if (e.type === "focusout" || e.which === 13) {
$(this).val($.trim($(this).val()));
}
});
});