* @param {HTMLElement} el The EventTarget to register the listenr on.
* @param {Node} el Node element
* @param {string} event The event type to listen for.
* @param {String} event Event type
* @param {Function} handler The function to handle the event.
* @param {Function} fn Callback of event
* @param {boolean} useCapture Specifices if the event to be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree.
* @return {Function}
* @param {boolean} passive A Boolean which, if true, indicates that the function specified by listener will never call preventDefault().
* Use a closure to return proper event listener method. Try to use
* `removeEventListener` by default but fallback to `detachEvent` for
* unsupported browser. The closure simply ensures that the test doesn't
* happen every time the method is called.
*
*
* @param {HTMLElement} el The EventTarget to unregister the listenr from.
* @param {Node} el Node element
* @param {string} event The event type to remove.
* @param {String} event Event type
* @param {Function} fn The event handler to remove.
* @param {Function} fn Callback of event
* @param {boolean} useCapture Specifices if the event to be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree.
* @return {Function}
* @param {boolean} passive A Boolean which, if true, indicates that the function specified by listener will never call preventDefault().
// flag to cancel click event if already handled by end resize event (the mousedown, mousemove, mouseup sequence fires a click event.).
varcancelClick=false,// flag to cancel click event if already handled by end resize event (the mousedown, mousemove, mouseup sequence fires a click event.).
varcancelClick=false;
modalClickHandlerTS=0// stores last click timestamp to prevent executing the handler twice on double click.
;
/**
/**
* Helper: closes the modal dialog when clicking the modal
* Helper: closes the modal dialog when clicking the modal