Skip to content

Commit 167f87b

Browse files
author
Tom Kaczocha
committed
Merge pull request #3 from rawphp/updates
Updates from Contributors and Test project
2 parents 789ab83 + 90e2335 commit 167f87b

8 files changed

Lines changed: 338 additions & 167 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
.idea
2-
bower_components
1+
bower_components

README.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3535
Initialise 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

4646
Heading: 'Delete Post'
4747

4848
Message: '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
5551
This 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
8182
Debug mode will output events and information to the console.
8283

@@ -93,14 +94,24 @@ Used if heading & message are not provided
9394
Will fire if responding to a button click that has no href attribute.
9495

9596
Use 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
98101
Will 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
101106
Will 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
105112
Copyright &copy; 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)

bootstrap-confirm-delete.css

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
.modal {
2-
3-
}
4-
5-
.fade {
6-
7-
}
8-
9-
.modal-dialog {
10-
11-
}
12-
13-
.modal-content {
14-
15-
}
16-
17-
.modal-header {
18-
19-
}
20-
21-
.modal-body {
22-
23-
}
24-
25-
.modal-footer {
26-
27-
}
28-
29-
#bootstrap-confirm-delete-container {
30-
31-
}
32-
33-
#bootstrap-confirm-dialog {
34-
35-
}
36-
37-
#bootstrap-confirm-dialog-heading {
38-
39-
}
40-
41-
#bootstrap-confirm-dialog-text {
42-
43-
}
44-
45-
#bootstrap-confirm-dialog-cancel-delete-btn {
46-
47-
}
48-
49-
#bootstrap-confirm-dialog-delete-btn {
50-
1+
.modal {
2+
3+
}
4+
5+
.fade {
6+
7+
}
8+
9+
.modal-dialog {
10+
11+
}
12+
13+
.modal-content {
14+
15+
}
16+
17+
.modal-header {
18+
19+
}
20+
21+
.modal-body {
22+
23+
}
24+
25+
.modal-footer {
26+
27+
}
28+
29+
#bootstrap-confirm-delete-container {
30+
31+
}
32+
33+
#bootstrap-confirm-dialog {
34+
35+
}
36+
37+
#bootstrap-confirm-dialog-heading {
38+
39+
}
40+
41+
#bootstrap-confirm-dialog-text {
42+
43+
}
44+
45+
#bootstrap-confirm-dialog-cancel-delete-btn {
46+
47+
}
48+
49+
#bootstrap-confirm-dialog-delete-btn {
50+
5151
}

0 commit comments

Comments
 (0)