diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index a3a957662..f77db15c2 100644 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -215,17 +215,20 @@ $.fn.modal = function(parameters) { event: { close: function() { - module.verbose('Closing element pressed'); - if( $(this).is(selector.approve) ) { - if(settings.onApprove.call(element) !== false) { + var + $element = $(this) + ; + module.verbose('Closing element activated'); + if( $element.is(selector.approve) ) { + if(settings.onApprove.call(element, $element) !== false) { module.hide(); } else { module.verbose('Approve callback returned false cancelling hide'); } } - else if( $(this).is(selector.deny) ) { - if(settings.onDeny.call(element) !== false) { + else if( $element.is(selector.deny) ) { + if(settings.onDeny.call(element, $element) !== false) { module.hide(); } else {