Skip to content
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

Fixes #3391 - Add ability to close modals with Esc key #3446

Merged
merged 4 commits into from
Aug 17, 2020
Merged

Conversation

miketaylr
Copy link
Member

@miketaylr miketaylr commented Aug 7, 2020

This lets users close the modal with Esc, and adds a test.

r? @ksy36

@miketaylr miketaylr marked this pull request as ready for review August 7, 2020 23:19
@miketaylr miketaylr requested a review from ksy36 August 7, 2020 23:19
modalTriggers.forEach(function (trigger) {
trigger.addEventListener("click", function (e) {
e.preventDefault();
sendAnalyticsEvent("whatIsCompat", "click");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out we sent this event when opening the "learn more" modal as well. 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops good catch!

@karlcow karlcow linked an issue Aug 10, 2020 that may be closed by this pull request
// transform trigger into camelCase and send as our event
popupTrigger.replace(/-([a-z])/g, function (match) {
return match[1].toUpperCase();
}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since analytics goal tracking for this step is set up as whatIsCompat, we probably need to keep it that way. It's possible to change the label, but then previous weeks data will still have the old label and won't be reflected in the statistics :(

We can probably change data-popup-trigger="what-is-webcompat" to data-popup-trigger="what-is-compat" (and same with data-popup-modal)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah! i didn't even notice the difference there, thanks :)

@miketaylr miketaylr requested a review from ksy36 August 17, 2020 16:45
@miketaylr
Copy link
Member Author

OK, just re-tested after changing the string. Seems to be working locally.

r? @ksy36

@miketaylr
Copy link
Member Author

(hm, test failure -- maybe hold off on review)

@ksy36
Copy link
Contributor

ksy36 commented Aug 17, 2020

lol I pressed rerun it before I saw your comment

@miketaylr
Copy link
Member Author

OK, tests seem happy, and merge conflict resolved. :)

@ksy36
Copy link
Contributor

ksy36 commented Aug 17, 2020

Thanks!

@ksy36 ksy36 merged commit f130ccd into master Aug 17, 2020
@ksy36 ksy36 deleted the issues/3397/1 branch August 17, 2020 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove JS code associated with the old form
2 participants