From 7be22cc1c7e73dadf473b2f452c393b68aae7f9c Mon Sep 17 00:00:00 2001 From: A Web Artisan <57477934+thewebartisan7@users.noreply.github.com> Date: Wed, 22 Jan 2020 06:51:12 +0100 Subject: [PATCH 1/2] Add support for bootstrap 4 Bootstrap 4 use class "show" and not "in" With this fix will works both on bootstrap 3 and 4. --- dist/bootstrap-session-timeout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/bootstrap-session-timeout.js b/dist/bootstrap-session-timeout.js index 1d65189..12b3a2e 100644 --- a/dist/bootstrap-session-timeout.js +++ b/dist/bootstrap-session-timeout.js @@ -172,7 +172,7 @@ function startDialogTimer() { // Clear session timer clearTimeout(timer); - if (!$('#session-timeout-dialog').hasClass('in') && (opt.countdownMessage || opt.countdownBar)) { + if ((!$('#session-timeout-dialog').hasClass('in') && !$('#session-timeout-dialog').hasClass('show')) && (opt.countdownMessage || opt.countdownBar)) { // If warning dialog is not already open and either opt.countdownMessage // or opt.countdownBar are set start countdown startCountdownTimer('dialog', true); From ffb364392e1c5aabb6113eedb6313b349e70f5d5 Mon Sep 17 00:00:00 2001 From: A Web Artisan <57477934+thewebartisan7@users.noreply.github.com> Date: Wed, 22 Jan 2020 06:59:56 +0100 Subject: [PATCH 2/2] Fix bootstrap 4 issue Second fix to support also bootstrap 4. Leaved support for bootstrap 3 --- dist/bootstrap-session-timeout.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dist/bootstrap-session-timeout.js b/dist/bootstrap-session-timeout.js index 12b3a2e..196204d 100644 --- a/dist/bootstrap-session-timeout.js +++ b/dist/bootstrap-session-timeout.js @@ -111,12 +111,11 @@ // but remove the modal too! if ($('#session-timeout-dialog').length > 0 && $('#session-timeout-dialog').data('bs.modal') && - $('#session-timeout-dialog').data('bs.modal').isShown) { + ($('#session-timeout-dialog').data('bs.modal').isShown || $('#session-timeout-dialog').data('bs.modal')._isShown)) { // http://stackoverflow.com/questions/11519660/twitter-bootstrap-modal-backdrop-doesnt-disappear $('#session-timeout-dialog').modal('hide'); $('body').removeClass('modal-open'); $('div.modal-backdrop').remove(); - } }); }