Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bootstrap 5 support #798

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bootbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
footer:
'<div class="modal-footer"></div>',
closeButton:
'<button type="button" class="bootbox-close-button btn-close" data-bs-dismiss="modal" aria-label="Close"></button>',
closeButton_bs_3_4:
'<button type="button" class="bootbox-close-button close" aria-hidden="true">&times;</button>',
form:
'<form class="bootbox-form"></form>',
Expand Down Expand Up @@ -358,7 +360,7 @@
}

if (options.closeButton) {
var closeButton = $(templates.closeButton);
var closeButton = $(options.bootstrap >= 5 ? templates.closeButton : templates.closeButton_bs_3_4);

if (options.title) {
if (options.bootstrap > 3) {
Expand Down Expand Up @@ -789,7 +791,9 @@
});

// safe to set a select's value as per a normal input
input.val(options.value);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#798 This was causing problems with the existing test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(options.value) {
input.val(options.value);
}

break;

Expand Down
2 changes: 1 addition & 1 deletion karma-base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function(params) {
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS'],
browsers: ['Chrome'],
captureTimeout: 60000,
singleRun: true,

Expand Down
9 changes: 9 additions & 0 deletions karma-bs4.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var baseConfig = require('./karma-base.conf');

module.exports = baseConfig({
vendor: [
'tests/vendor/jquery-3.3.1.slim.min.js',
'tests/vendor/bootstrap-4.3.1.bundle.min.js'
],
src: ['bootbox.js', 'bootbox.locales.js']
});
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var baseConfig = require('./karma-base.conf');
module.exports = baseConfig({
vendor: [
'tests/vendor/jquery-3.3.1.slim.min.js',
'tests/vendor/bootstrap-4.3.1.bundle.min.js'
'tests/vendor/bootstrap-5.1.3.bundle.min.js'
],
src: ['bootbox.js', 'bootbox.locales.js']
});
});
Loading