@@ -29,7 +29,7 @@ on any links or buttons that have the 'delete' class on them.
2929```
3030
3131``` html
32- <a href =" server.php" class =" delete" data_type =" post" >Delete</a >
32+ <a href =" server.php" class =" delete" data-type =" post" >Delete</a >
3333```
3434
3535Initialise the plugin either in <script ></script > tags on the html page or in an external .js script.
@@ -41,16 +41,12 @@ $( document ).ready( function( )
4141} );
4242```
4343
44- Notice the 'data_type ' attribute on the link. The plugin will use this attribute if set to show a custom delete message. For example,
44+ Notice the 'data-type ' attribute on the link. The plugin will use this attribute if set to show a custom delete message. For example,
4545
4646Heading: 'Delete Post'
4747
4848Message: 'Are you sure you want to delete this post?'
4949
50-
51- ## Options
52- Bootstrap Confirm Delete plugin comes with several option settings.
53-
5450### Example
5551This example shows all the available options:
5652
@@ -63,20 +59,25 @@ $( document ).ready( function( )
6359 heading: ' My Custom Delete Heading' ,
6460 message: ' Are you sure you want to delete this item?' ,
6561 data_type: ' post' ,
66- callback : function ( event )
67- {
68- // grab original clicked delete button
69- var button = event .data .originalObject ;
70- // execute delete operation
71- button .closest ( ' tr' ).remove ();
72- },
62+ callback : function ( event )
63+ {
64+ // grab original clicked delete button
65+ var button = event .data .originalObject ;
66+ // execute delete operation
67+ button .closest ( ' tr' ).remove ();
68+ },
7369 delete_callback : function () { console .log ( ' delete button clicked' ); },
7470 cancel_callback : function () { console .log ( ' cancel button clicked' ); }
7571 }
7672 );
7773} );
7874```
7975
76+ ### See test directory for a more complete example
77+
78+ ## Options
79+ Bootstrap Confirm Delete plugin comes with several optional settings.
80+
8081### debug
8182Debug mode will output events and information to the console.
8283
@@ -93,14 +94,24 @@ Used if heading & message are not provided
9394Will fire if responding to a button click that has no href attribute.
9495
9596Use this callback to do any deletions from a button click.
97+ Parameters:
98+ * data (data.originalObject contains the originally clicked object)
9699
97100### delete_callback
98101Will fire when the delete button is clicked and a handler is provided.
102+ Parameters:
103+ * data (data.originalObject contains the originally clicked object)
99104
100105### cancel_callback
101106Will fire when the cancel button is clicked and a handler is provided.
107+ Parameters:
108+ * data (data.originalObject contains the originally clicked object)
102109
103110
104111## License
105112Copyright © ; 2015 Tom Kaczocha < tom@rawphp.org >
106- Licensed under the MIT license.
113+ Licensed under the MIT license.
114+
115+ ## Contributors
116+ Special thanks to:
117+ * [ mpecan] ( https://github.com/mpecan )
0 commit comments