From: Bill Erickson Date: Wed, 19 Aug 2015 16:23:06 +0000 (-0400) Subject: JBAS-821 aviod unnecessary timer resets X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=52b9581fe7cbe7dbd22c32a3a49281dcfdac76f2;p=working%2FEvergreen.git JBAS-821 aviod unnecessary timer resets KCLS custom code resets the patron timer even when the patron is not logged in. This causes the logout warning to appear even when no patron is logged in. Avoid this by preventing the timer from starting when no patron is logged in. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js b/Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js index 1e04a6ee61..307f5f1576 100644 --- a/Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js +++ b/Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js @@ -19,6 +19,7 @@ var timerId = null; var patronTimeoutWarning = 20000; var selfckWarningSetup = false; var selfckWarningTimer; +var selfCheckManager; var selfCheckMgr; @@ -53,9 +54,13 @@ function selfckStartTimer() { // reset the logout timer function selfckResetTimer() { - console.log('resetting timer'); + console.log('clearing login timer'); clearTimeout(timerId); - selfckStartTimer(); + + if (selfCheckManager && selfCheckManager.patron) { + console.log('Starting new login timer'); + selfckStartTimer(); + } } function selfckLogoutWarning() { @@ -1590,7 +1595,8 @@ function cancelLogin() { */ openils.Util.addOnLoad( function() { - new SelfCheckManager().init(); + selfCheckManager = new SelfCheckManager(); + selfCheckManager.init(); openils.Util.registerEnterHandler(dojo.byId('patron-login-username'), function(){checkLogin();}); openils.Util.registerEnterHandler(dojo.byId('patron-login-password'), function(){selfCheckMgr.loginPatron(dojo.byId('patron-login-username').value,dojo.byId('patron-login-password').value);}); }