Skip to content

Commit 444114d

Browse files
author
Tom Kaczocha
committed
Added ability to pass original element to callback.
1 parent 57cb5c6 commit 444114d

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

bootstrap-confirm-delete.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,16 @@
3737

3838
if ( null !== settings.callback )
3939
{
40-
$( '#bootstrap-confirm-dialog-delete-btn' ).attr( 'data-dismiss', 'modal');
41-
42-
$( 'a#bootstrap-confirm-dialog-delete-btn' ).on( 'click', settings.callback );
40+
$( '#bootstrap-confirm-dialog-delete-btn' ).attr( 'data-dismiss', 'modal' );
41+
42+
if ( $.isFunction( settings.callback ) )
43+
{
44+
$( 'a#bootstrap-confirm-dialog-delete-btn' ).on( 'click', { originalObject: this }, settings.callback );
45+
}
46+
else
47+
{
48+
console.log( settings.callback + ' is not a valid callback' );
49+
}
4350
}
4451
else if ( '' !== event.currentTarget.href )
4552
{

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bootstrap-confirm-delete",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"homepage": "https://github.com/rawphp/Bootstrap-Confirm-Delete",
55
"authors": [
66
"Tom Kaczocha <tom@rawphp.org>"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bootstrap-confirm-delete",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Bootstrap confirm delete modal dialog jquery plugin",
55
"main": "bootstrap-confirm-dialog.js",
66
"scripts": {

0 commit comments

Comments
 (0)