From e2c6adc18ed584abf5b162c2ca88dbcd2e2ffedb Mon Sep 17 00:00:00 2001 From: Zach Kirkland Date: Thu, 21 Mar 2019 15:50:23 -0500 Subject: [PATCH 1/5] add more control added options: logoutButtonCallback, keepAliveButtonCallback, activityHidesModal, resetTimerWhileModalOpen, isModalStatic. * logoutButtonCallback, keepAliveButtonCallback (default: false) ** gives user ability to set custom callbacks for the buttons * activityHidesModal (default: true) ** allows the user to ensure the modal does not hide on mouse/keyboard activity * resetTimerWhileModalOpen (default: true) ** allows user to disable timer reset while the modal is open. * isModalStatic (default: false) ** allows user to keep disable dismissal of the modal by clicking outside of the modal or pressing escape. --- dist/bootstrap-session-timeout.js | 58 +++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/dist/bootstrap-session-timeout.js b/dist/bootstrap-session-timeout.js index 1d65189..64bdfea 100644 --- a/dist/bootstrap-session-timeout.js +++ b/dist/bootstrap-session-timeout.js @@ -14,7 +14,9 @@ title: 'Your Session is About to Expire!', message: 'Your session is about to expire.', logoutButton: 'Logout', + logoutButtonCallback: false, keepAliveButton: 'Stay Connected', + keepAliveButtonCallback: false, keepAliveUrl: '/keep-alive', ajaxType: 'POST', ajaxData: '', @@ -30,7 +32,10 @@ onRedir: false, countdownMessage: false, countdownBar: false, - countdownSmart: false + countdownSmart: false, + activityHidesModal: true, + resetTimerWhileModalOpen: true, + isModalStatic: false }; var opt = defaults, @@ -60,8 +65,10 @@ \ ' : ''; + var modalStaticAttributes = opt.isModalStatic ? 'data-backdrop="static" data-keyboard="false"' : ''; + // Create timeout warning dialog - $('body').append('