Skip to content

Commit

Permalink
Merge pull request #767 from adhayward/master
Browse files Browse the repository at this point in the history
Fix for Issue #766
  • Loading branch information
tiesont authored Sep 28, 2020
2 parents 5db1012 + ccb189d commit f079264
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bootbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
// Bootbox event listeners; used to decouple some
// behaviours from their respective triggers

if (options.backdrop !== 'static') {
if (options.backdrop === true) {
// A boolean true/false according to the Bootstrap docs
// should show a dialog the user can dismiss by clicking on
// the background.
Expand Down Expand Up @@ -493,7 +493,7 @@
$(options.container).append(dialog);

dialog.modal({
backdrop: options.backdrop ? 'static' : false,
backdrop: options.backdrop,
keyboard: false,
show: false
});
Expand Down Expand Up @@ -1069,7 +1069,13 @@
if (!options.buttons) {
options.buttons = {};
}

//make sure backdrop is either true/false/static
if (!options.backdrop) {
options.backdrop = (options.backdrop === false || options.backdrop === 0) ? false : 'static';
} else {
options.backdrop = typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static' ? 'static' : true;
}

buttons = options.buttons;

total = getKeyLength(buttons);
Expand Down Expand Up @@ -1228,4 +1234,4 @@

// The Bootbox object
return exports;
}));
}));

0 comments on commit f079264

Please sign in to comment.