From cc2ef13283738b03eb65133c786867c1450bc9e5 Mon Sep 17 00:00:00 2001 From: David Vandemaele Date: Thu, 15 Sep 2022 13:09:56 +0200 Subject: [PATCH] Pass original event to callback action --- js/bootstrap.confirm-modal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/bootstrap.confirm-modal.js b/js/bootstrap.confirm-modal.js index a0632b8..6db2233 100644 --- a/js/bootstrap.confirm-modal.js +++ b/js/bootstrap.confirm-modal.js @@ -44,7 +44,7 @@ $(function ( $ ) { template = template.replace('%%btn_href%%', 'javascript:void(0)'); } - ev.preventDefault(); + ev.preventDefault(); if (!$('#dataConfirmModal').length) { $('body').append(template); @@ -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; }); @@ -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; });