Add support for closeOnClick option.