Browse Source

Adds parameter to onApprove, onDeny #2191

pull/2209/head
jlukic 9 years ago
parent
commit
c5877b670d
1 changed files with 8 additions and 5 deletions
  1. 13
      src/definitions/modules/modal.js

13
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 {

Loading…
Cancel
Save