From d7a114c3504cb2662066d6d689d5dd96bce2f79a Mon Sep 17 00:00:00 2001 From: Adam Hayward <18305551+adhayward@users.noreply.github.com> Date: Thu, 20 Aug 2020 13:55:03 +0100 Subject: [PATCH 1/3] Fix for Issue #766 --- bootbox.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/bootbox.js b/bootbox.js index 2d213e96..4c479723 100644 --- a/bootbox.js +++ b/bootbox.js @@ -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. @@ -493,7 +493,7 @@ $(options.container).append(dialog); dialog.modal({ - backdrop: options.backdrop ? 'static' : false, + backdrop: options.backdrop, keyboard: false, show: false }); @@ -1069,7 +1069,21 @@ if (!options.buttons) { options.buttons = {}; } - + //make sure backdrop is either true/false/static + if (!options.backdrop) { + if (options.backdrop === false || options.backdrop === 0) { //false values + options.backdrop = false; + } else { //null values + options.backdrop = 'static'; + } + } else { + if (typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static') { //static string + options.backdrop = 'static'; + } else { //Anything true + options.backdrop = true; + } + } + buttons = options.buttons; total = getKeyLength(buttons); @@ -1228,4 +1242,4 @@ // The Bootbox object return exports; -})); \ No newline at end of file +})); From eb3466eec7a6eb9e29620f151d7d6ee891364a73 Mon Sep 17 00:00:00 2001 From: Adam Hayward <18305551+adhayward@users.noreply.github.com> Date: Wed, 26 Aug 2020 11:09:26 +0100 Subject: [PATCH 2/3] Update bootbox.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tarmo Leppänen --- bootbox.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/bootbox.js b/bootbox.js index 4c479723..138e3ebf 100644 --- a/bootbox.js +++ b/bootbox.js @@ -1071,17 +1071,9 @@ } //make sure backdrop is either true/false/static if (!options.backdrop) { - if (options.backdrop === false || options.backdrop === 0) { //false values - options.backdrop = false; - } else { //null values - options.backdrop = 'static'; - } + options.backdrop ? (options.backdrop === false || options.backdrop === 0) ? false : static; } else { - if (typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static') { //static string - options.backdrop = 'static'; - } else { //Anything true - options.backdrop = true; - } + options.backdrop = typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static' ? 'static' : true; } buttons = options.buttons; From ccb189d118c807c7795327334a7ba1ed33e9ca68 Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Mon, 28 Sep 2020 19:55:15 -0400 Subject: [PATCH 3/3] Update bootbox.js --- bootbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootbox.js b/bootbox.js index 138e3ebf..5f9bfe7c 100644 --- a/bootbox.js +++ b/bootbox.js @@ -1071,7 +1071,7 @@ } //make sure backdrop is either true/false/static if (!options.backdrop) { - options.backdrop ? (options.backdrop === false || options.backdrop === 0) ? false : static; + options.backdrop = (options.backdrop === false || options.backdrop === 0) ? false : 'static'; } else { options.backdrop = typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static' ? 'static' : true; }