08.04.2024, 13:35
(08.04.2024, 10:11)admin Wrote: Use this revised version. The timeout timer is reset when a plan changes (either by user interaction or by calling showPlan):
Code:$(function() { var timeout = 5 // in seconds var ticks = 0 var events = 'vclick vmousedown vmouseout touchend' setInterval(function() { ticks++ if (ticks == timeout) { window.location = '/logout' } }, 1000) function reset() { ticks = 0 } $(document).on(events, reset) $(document.body).on('showplan', reset) $('iframe').load(function() { try { $(this).contents().find('html').on(events, reset) } catch (e) {} }) })
It still doesn't work for iframes unfortunately.