Autoclose option for the modal popup

Fixes #287 by checking if 'autoclose' option is set outside the mousedown/touchstart callback and not checking for the 'modal' option