From 3ad73aaba50791c23aecc65b08c4614ce7147328 Mon Sep 17 00:00:00 2001 From: Parth Date: Mon, 31 Jul 2023 17:42:45 +0530 Subject: [PATCH] Update jquery-idleTimeout.js After jQuery latest update 3.6.0, event binding is not working if document is not ready/loaded. --- jquery-idleTimeout.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jquery-idleTimeout.js b/jquery-idleTimeout.js index 0fe2404..c16d28c 100644 --- a/jquery-idleTimeout.js +++ b/jquery-idleTimeout.js @@ -101,12 +101,12 @@ //----------- ACTIVITY DETECTION FUNCTION --------------// activityDetector = function () { - - $('body').on(currentConfig.activityEvents, function () { - - if (!currentConfig.enableDialog || (currentConfig.enableDialog && isDialogOpen() !== true)) { - startIdleTimer(); - } + $(document).ready(function() { + $('body').on(currentConfig.activityEvents, function () { + if (!currentConfig.enableDialog || (currentConfig.enableDialog && isDialogOpen() !== true)) { + startIdleTimer(); + } + }); }); }; @@ -277,4 +277,4 @@ }); }; -}(jQuery)); \ No newline at end of file +}(jQuery));