@@ -61,19 +61,16 @@ <h1>Bootstrap Confirmation</h1>
61
61
< div class ="card-body ">
62
62
< button class ="btn btn-primary " data-toggle ="confirmation " data-placement ="left "> Confirmation on left</ button >
63
63
< button class ="btn btn-primary " data-toggle ="confirmation " data-placement ="top "> Confirmation on top</ button >
64
- < button class ="btn btn-primary " data-toggle ="confirmation " data-placement ="bottom "> Confirmation on bottom
65
- </ button >
64
+ < button class ="btn btn-primary " data-toggle ="confirmation " data-placement ="bottom "> Confirmation on bottom</ button >
66
65
< button class ="btn btn-primary " data-toggle ="confirmation " data-placement ="right "> Confirmation on right</ button >
67
66
</ div >
68
67
</ div >
69
68
70
69
< div class ="card mb-3 ">
71
70
< div class ="card-header "> Singleton</ div >
72
71
< div class ="card-body ">
73
- < button class ="btn btn-primary " data-toggle ="confirmation-singleton " data-singleton ="true "> Confirmation 1
74
- </ button >
75
- < button class ="btn btn-primary " data-toggle ="confirmation-singleton " data-singleton ="true "> Confirmation 2
76
- </ button >
72
+ < button class ="btn btn-primary " data-toggle ="confirmation-singleton " data-singleton ="true "> Confirmation 1</ button >
73
+ < button class ="btn btn-primary " data-toggle ="confirmation-singleton " data-singleton ="true "> Confirmation 2</ button >
77
74
</ div >
78
75
</ div >
79
76
@@ -107,8 +104,19 @@ <h1>Bootstrap Confirmation</h1>
107
104
< div class ="card mb-3 ">
108
105
< div class ="card-header "> Custom buttons</ div >
109
106
< div class ="card-body ">
110
- < button class ="btn btn-primary " id ="custom-confirmation "> Choose your transportation</ button >
111
- < button class ="btn btn-primary " id ="custom-confirmation-links "> Share to</ button >
107
+ < button class ="btn btn-primary " data-toggle ="confirmation-custom "> Choose your transportation</ button >
108
+ < button class ="btn btn-primary " data-toggle ="confirmation-custom-links "> Share to</ button >
109
+ </ div >
110
+ </ div >
111
+
112
+ < div class ="card mb-3 ">
113
+ < div class ="card-header "> Override data attributes</ div >
114
+ < div class ="card-body ">
115
+ < button class ="btn btn-primary " data-toggle ="confirmation-override "> No overrides</ button >
116
+ < button class ="btn btn-primary " data-toggle ="confirmation-override "
117
+ data-btn-ok-label ="Ok " data-btn-ok-class ="btn btn-sm btn-success ">
118
+ Override OK
119
+ </ button >
112
120
</ div >
113
121
</ div >
114
122
</ div >
@@ -126,25 +134,22 @@ <h1>Bootstrap Confirmation</h1>
126
134
127
135
$ ( '[data-toggle=confirmation]' ) . confirmation ( {
128
136
rootSelector : '[data-toggle=confirmation]' ,
129
- container : 'body'
137
+ container : 'body' ,
130
138
} ) ;
131
139
$ ( '[data-toggle=confirmation-singleton]' ) . confirmation ( {
132
140
rootSelector : '[data-toggle=confirmation-singleton]' ,
133
- container : 'body'
134
141
} ) ;
135
142
$ ( '[data-toggle=confirmation-popout]' ) . confirmation ( {
136
143
rootSelector : '[data-toggle=confirmation-popout]' ,
137
- container : 'body'
138
144
} ) ;
139
145
140
146
$ ( '#confirmation-delegate' ) . confirmation ( {
141
- selector : 'button'
147
+ selector : 'button' ,
142
148
} ) ;
143
149
144
150
$ ( '[data-toggle=custom-confirmation-events]' )
145
151
. confirmation ( {
146
152
rootSelector : '[data-toggle=custom-confirmation-events]' ,
147
- container : 'body'
148
153
} )
149
154
. on ( 'mouseenter' , function ( ) {
150
155
$ ( this ) . confirmation ( 'show' ) ;
@@ -153,11 +158,16 @@ <h1>Bootstrap Confirmation</h1>
153
158
alert ( '"myevent" triggered' ) ;
154
159
} ) ;
155
160
156
- $ ( '#custom-confirmation' ) . confirmation ( {
161
+ $ ( '[data-toggle=confirmation-override]' ) . confirmation ( {
162
+ rootSelector : '[data-toggle=confirmation-override]' ,
163
+ btnOkLabel : 'Continue' ,
164
+ btnCancelLabel : 'Cancel' ,
165
+ } ) ;
166
+
167
+ $ ( '[data-toggle=confirmation-custom]' ) . confirmation ( {
157
168
rootSelector : '#custom-confirmation' ,
158
- container : 'body' ,
159
169
title : '' ,
160
- onConfirm : function ( value ) {
170
+ onConfirm ( value ) {
161
171
alert ( 'You choosed ' + value ) ;
162
172
} ,
163
173
buttons : [
@@ -166,62 +176,61 @@ <h1>Bootstrap Confirmation</h1>
166
176
iconClass : 'material-icons mr-1' ,
167
177
iconContent : 'directions_railway' ,
168
178
label : 'Railway' ,
169
- value : 'Railway'
179
+ value : 'Railway' ,
170
180
} ,
171
181
{
172
182
class : 'btn btn-sm btn-primary' ,
173
183
iconClass : 'material-icons mr-1' ,
174
184
iconContent : 'directions_car' ,
175
185
label : 'Car' ,
176
- value : 'Car'
186
+ value : 'Car' ,
177
187
} ,
178
188
{
179
189
class : 'btn btn-sm btn-warning' ,
180
190
iconClass : 'material-icons mr-1' ,
181
191
iconContent : 'directions_boat' ,
182
192
label : 'Boat' ,
183
- value : 'Boat'
193
+ value : 'Boat' ,
184
194
} ,
185
195
{
186
196
class : 'btn btn-sm btn-secondary' ,
187
197
iconClass : 'material-icons mr-1' ,
188
198
iconContent : 'cancel' ,
189
199
label : 'Cancel' ,
190
- cancel : true
191
- }
192
- ]
200
+ cancel : true ,
201
+ } ,
202
+ ] ,
193
203
} ) ;
194
204
195
- $ ( '#custom- confirmation-links' ) . confirmation ( {
205
+ $ ( '[data-toggle= confirmation-custom- links] ' ) . confirmation ( {
196
206
rootSelector : '#custom-confirmation-link' ,
197
- container : 'body' ,
198
207
title : '' ,
199
208
buttons : [
200
209
{
201
210
label : 'Twitter' ,
202
211
iconClass : 'fa fa-twitter fa-lg mr-1' ,
203
212
attr : {
204
213
href : 'https://twitter.com' ,
205
- target : '_blank'
206
- }
214
+ target : '_blank' ,
215
+ } ,
207
216
} ,
208
217
{
209
218
label : 'Facebook' ,
210
219
iconClass : 'fa fa-facebook fa-lg mr-1' ,
211
220
attr : {
212
221
href : 'https://facebook.com' ,
213
- target : '_blank'
214
- }
222
+ target : '_blank' ,
223
+ } ,
215
224
} ,
216
225
{
217
226
label : 'Pinterest' ,
218
227
iconClass : 'fa fa-pinterest fa-lg mr-1' ,
219
228
attr : {
220
229
href : 'https://pinterest.com' ,
221
- target : '_blank'
222
- }
223
- }
224
- ]
230
+ target : '_blank' ,
231
+ } ,
232
+ } ,
233
+ ] ,
225
234
} ) ;
226
235
</ script >
227
236
0 commit comments