From c5877b670d146a2fe9a03e9e0555e8c2bf358c9a Mon Sep 17 00:00:00 2001 From: jlukic Date: Thu, 30 Apr 2015 11:54:24 -0400 Subject: [PATCH] Adds parameter to onApprove, onDeny #2191 --- src/definitions/modules/modal.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 {