Check onOpen definition instead of onClose
Merge pull request #1 from arjeousski/master

openModal checks for onClose instead of onOpen callback