Added functionality for on click event

Added option for on click event

On click will not be triggered on clicking close button