Skip to content

Commit

Permalink
Pass original event to callback action
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvandemaele authored Sep 15, 2022
1 parent e306ad0 commit cc2ef13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/bootstrap.confirm-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $(function ( $ ) {
template = template.replace('%%btn_href%%', 'javascript:void(0)');
}

ev.preventDefault();
ev.preventDefault();

if (!$('#dataConfirmModal').length) {
$('body').append(template);
Expand All @@ -61,7 +61,7 @@ $(function ( $ ) {
if (data.callback_ok) {
$('body').on('click.confirm', '#dataConfirmModal #data-confirm-ok', function (e) {
e.preventDefault();
window[data.callback_ok].call(this);
window[data.callback_ok](this, ev);
$('body').off('click.confirm', '#dataConfirmModal #data-confirm-ok').off('click.cancel', '#dataConfirmModal #data-confirm-cancel');
return false;
});
Expand All @@ -74,7 +74,7 @@ $(function ( $ ) {
if (data.callback_cancel) {
$('body').on('click.cancel', '#dataConfirmModal #data-confirm-cancel', function (e) {
e.preventDefault();
window[data.callback_cancel].call(this);
window[data.callback_cancel](this, ev);
$('body').off('click.confirm', '#dataConfirmModal #data-confirm-ok').off('click.cancel', '#dataConfirmModal #data-confirm-cancel');
return false;
});
Expand Down

0 comments on commit cc2ef13

Please sign in to comment.