Fixed escape click event - missing a check of escape option

While clicking ESC, the modal should be closed only if the the escape options is set to true. The code is missing a check of the state of this flag while triggering the "cancel" event caused by a click on ESC button.