-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug 1335331 - Enable users to change their email address #793
Changes from 15 commits
8ee9a1d
6f1e755
fe26247
18ed578
9a3829e
3b360cb
bec393a
64ac44a
3fa8e18
3b25d3b
021eeef
e61b893
06fc386
05602c8
0747dae
dde7dfc
0400924
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,19 @@ $(function() { | |
} | ||
}); | ||
}); | ||
|
||
// Show a warning when a user changes their email address. | ||
var emailField = $('#id_email'); | ||
var warningContent = $('#email-warning'); | ||
var originalEmail = emailField.val(); | ||
|
||
emailField.on('keyup', function () { | ||
var newEmail = emailField.val(); | ||
if (newEmail === originalEmail && warningContent.is(':visible')) { | ||
warningContent.hide(); | ||
} | ||
else if (newEmail !== originalEmail && !warningContent.is(':visible')) { | ||
warningContent.show(); | ||
} | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not a big fan of this. It doesn't work if you paste the email address using the mouse and the context menu for example. It also adds a lot of code. Unrelatedly, there's a usability issue with this text - it gets overflown by the autocomplete box. We could move it to the right of the field, and possibly make it fit into two lines. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree about the usability issue, and I'm going to fix it, but I don't understand your point about "a lot of code". That's only 10 lines, and I don't think it can be done with much less. The CSS-only solution had a different bunch of usability issues. Do you think we should do without that feature entirely instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd definitely keep the message, because changing the email address leads to an unexpected action. It's a lot of code relatively speaking - compared to the CSS solution. What are the usability issues there? We could also make the text always visible (althout not red in this case) or make it pop up on form save if the email address changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quoting my commit message:
I was going to consider going for a tooltip to the right of the input box instead of a red text below. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank line missing!