fleet/frontend/components/ClickOutside/helpers.js
Mike Stone 1acd011ca9 Show hosts page (#311)
* Adds manage hosts page and improves side bar functionality

* API client get hosts

* Adds hosts to redux state

* Adds host details component

* Manage hosts page renders host details

* ElipsisMenu component

* Add ElipsisMenu to HostDetails

* Adds HOC to detect clicks outside component

* clicks outside ElipsisMenu close the tooltip

* Adds icons to host details component
2016-10-17 14:55:03 -04:00

12 lines
269 B
JavaScript

export const handleClickOutside = (clickHandler, componentNode) => {
return (evt) => {
const { target: clickedNode } = evt;
if (componentNode.contains(clickedNode)) return false;
return clickHandler(evt);
};
};
export default { handleClickOutside };