|
46 | 46 | text: '<input class="bootbox-input bootbox-input-text form-control" autocomplete="off" type="text" />',
|
47 | 47 | textarea: '<textarea class="bootbox-input bootbox-input-textarea form-control"></textarea>',
|
48 | 48 | email: '<input class="bootbox-input bootbox-input-email form-control" autocomplete="off" type="email" />',
|
49 |
| - select: '<select class="bootbox-input bootbox-input-select form-control"></select>', |
| 49 | + select: '<select class="bootbox-input bootbox-input-select form-select"></select>', |
50 | 50 | checkbox: '<div class="form-check checkbox"><label class="form-check-label"><input class="form-check-input bootbox-input bootbox-input-checkbox" type="checkbox" /></label></div>',
|
51 | 51 | radio: '<div class="form-check radio"><label class="form-check-label"><input class="form-check-input bootbox-input bootbox-input-radio" type="radio" name="bootbox-radio" /></label></div>',
|
52 | 52 | date: '<input class="bootbox-input bootbox-input-date form-control" autocomplete="off" type="date" />',
|
|
331 | 331 | }
|
332 | 332 | }
|
333 | 333 |
|
334 |
| - if(options.title){ |
335 |
| - header.find('.modal-title').html(options.title); |
336 |
| - } |
337 |
| - else { |
338 |
| - header.addClass('pb-0 border-0'); |
339 |
| - } |
| 334 | + if(options.title || options.closeButton){ |
| 335 | + if (options.title) { |
| 336 | + header.find('.modal-title').html(options.title); |
| 337 | + } |
340 | 338 |
|
341 |
| - body.before(header); |
| 339 | + if (options.closeButton) { |
| 340 | + let closeButton = $(templates.closeButton); |
| 341 | + if (options.bootstrap < 5) { |
| 342 | + closeButton.html('×'); |
| 343 | + } |
342 | 344 |
|
343 |
| - if (options.closeButton) { |
344 |
| - let clsbtn = $(templates.closeButton); |
345 |
| - if (options.fullBootstrapVersion < '5.0.0') { |
346 |
| - clsbtn.html('×'); |
| 345 | + /* Note: the close button for Bootstrap 5+ does not contain content */ |
| 346 | + if(options.bootstrap < 4){ |
| 347 | + /* Bootstrap 3 and under */ |
| 348 | + header.prepend(closeButton); |
| 349 | + } |
| 350 | + else { |
| 351 | + header.append(closeButton); |
| 352 | + } |
347 | 353 | }
|
348 | 354 |
|
349 |
| - /* Note: the close button for Bootstrap 5+ does not contain content */ |
350 |
| - if(options.bootstrap < 4){ |
351 |
| - dialog.find('.modal-header').append(clsbtn); |
352 |
| - } |
353 |
| - else { |
354 |
| - /* Bootstrap 3 and under */ |
355 |
| - dialog.find('.modal-header').prepend(clsbtn); |
356 |
| - } |
| 355 | + body.before(header); |
357 | 356 | }
|
358 | 357 |
|
359 | 358 | if (options.centerVertical) {
|
|
755 | 754 |
|
756 | 755 | // Safe to set a select's value as per a normal input
|
757 | 756 | input.val(options.value);
|
| 757 | + if (options.bootstrap < 5) { |
| 758 | + input.removeClass('form-select').addClass('form-control'); |
| 759 | + } |
758 | 760 | break;
|
759 | 761 |
|
760 | 762 | case 'checkbox':
|
|
0 commit comments