HexagonJS
Edit Page
Click Detector
Provides a way to listen for clicks outside an element.
Examples
detector = new hx.ClickDetector();

detector.addException(hx.select('#titlebar').node());

detector.on('click', function(){
  // user clicked outside the titlebar
  ...
});
Api
Prototypes
hx.ClickDetectorextendsEventEmitter
Constructors
hx.ClickDetector
Creates a component that provides a way to listen for clicks outside an element.
Events
click
Emitted when a click occurs outside all of the exceptions.
Methods
addExceptionelementElementClickDetector
Adds an exception to the click detector so that the element (or any of it's children) do not fire the on click event.
Arguments
elementElement
The element to add as an exception
Returns
ClickDetector
This ClickDetector for chaining
cleanUpClickDetector
Deregisters the listeners that were added when the ClickDetector was created. After calling this the click detector should not be used any more.
Returns
ClickDetector
This ClickDetector for chaining
removeAllExceptionsClickDetector
Removes all exceptions from this ClickDetector
Returns
ClickDetector
This ClickDetector for chaining
removeExceptionelementElementClickDetector
Removes an exception from the click detector.
Arguments
elementElement
The element to remove as an exception
Returns
ClickDetector
This ClickDetector for chaining