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

Hide the usermenu on outside click #1804

Merged
merged 3 commits into from Apr 19, 2018

Conversation

Projects
None yet
3 participants
@jseppi
Contributor

jseppi commented Apr 19, 2018

Modifies the behavior of the header user menu to hide not only on click of its trigger link, but also on click of anywhere outside of its descendants.

Part of the tweaks requested in #1708 cc @ericronne

@jseppi jseppi self-assigned this Apr 19, 2018

@jseppi jseppi requested a review from toolness Apr 19, 2018

James Seppi
hide the usermenu on outside click
Modifies the behavior of the header usermenu to hide not only on click of its trigger link, but also on click of anywhere outside of its descendents.

@jseppi jseppi force-pushed the hide-usermenu-bodyclick branch from 14ecc78 to 347fa7f Apr 19, 2018

@ericronne

This comment has been minimized.

Contributor

ericronne commented Apr 19, 2018

Yes, awesome!

* Determines if `targetEl` is a descendant of the given `parentEl`.
*
* @param { HTMLElement|Element } parentEl the parent element
* @param { HTMLElement|EventTarget|Element|null } targetEl the element in question

This comment has been minimized.

@hbillings

hbillings Apr 19, 2018

Member

I've never seen this sort of syntax before -- what's it called so I can google it?

This comment has been minimized.

@jseppi

jseppi Apr 19, 2018

Contributor

They’re jsdoc style comments that are interpreted by typescript for type annotation/checking

This comment has been minimized.

@jseppi

jseppi Apr 19, 2018

Contributor

There’s really nice editor integration for these annotations in vscode and probably other editors. Maybe even vim?

@hbillings

Woo! Totally referencing this next time I use the WDS menu dropdowns and want to make them close on external clicks.

@jseppi jseppi merged commit 02ffc57 into develop Apr 19, 2018

3 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
codeclimate All good!
Details
codeclimate/total-coverage 92% (0.0% change)
Details

@hbillings hbillings deleted the hide-usermenu-bodyclick branch Sep 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment