From b3aec78b73cef95480a7acfa8b70129b5be14216 Mon Sep 17 00:00:00 2001 From: jhamsle <70334441+jhamsle@users.noreply.github.com> Date: Thu, 29 Sep 2022 11:27:11 -0500 Subject: [PATCH] Update jTimeout.js I made the "hideCountdownAlert" function overriddable. This way if someone wants to control their dialog/UI they'll be able to have it close properly across multiple windows. Note: "timeout.timeoutWarning = false;" should still be in the overridden method, or the pop-up won't display again and will continually fire "close" events. --- src/jTimeout.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/jTimeout.js b/src/jTimeout.js index 0e691f3..69b0e1f 100755 --- a/src/jTimeout.js +++ b/src/jTimeout.js @@ -133,20 +133,6 @@ { timeout.priorCountDown = elem; }, - /** - * Hides the countdown alert - */ - hideCountdownAlert: function() - { - timeout.timeoutWarning = false; - - var timeoutAlert = $('#jTimeoutAlert'); - - if (timeoutAlert.length > 0) - { - timeoutAlert.closeAlert(); - } - }, setMouseTimeout: function(timeout) { this.mouseTimeout = timeout; @@ -241,7 +227,7 @@ { timeout.stopFlashing(); timeout.stopPriorCountdown(); - timeout.hideCountdownAlert(); + timeout.options.hideCountdownAlert(); } }, /* Kill the plugin by removing all event handlers and current activities (like flashing) */ @@ -369,6 +355,20 @@ onSessionExtended: function(timeout) { $('#jTimedoutAlert').closeAlert(); + }, + /** + * Hides the countdown alert + */ + hideCountdownAlert: function() + { + timeout.timeoutWarning = false; + + var timeoutAlert = $('#jTimeoutAlert'); + + if (timeoutAlert.length > 0) + { + timeoutAlert.closeAlert(); + } } };