diff --git a/scp/js/scp.js b/scp/js/scp.js index 1b9327b5275dd08e595080f53cc4ca0caf76c08d..58ced5d337bb21546eecce6c47824f9a312f217c 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -1004,8 +1004,6 @@ $(document).on('pjax:start', function() { $.toggleOverlay(false); // Close tooltips $('.tip_box').remove(); - // Cancel refreshes - clearInterval(window.ticket_refresh); }); $(document).on('pjax:send', function(event) { diff --git a/scp/js/ticket.js b/scp/js/ticket.js index 9dc493ad8948536f15dfa281c8b47849a4f66549..897fafa8e261ecc1aba96e86426cb2a99aa3ea53 100644 --- a/scp/js/ticket.js +++ b/scp/js/ticket.js @@ -279,8 +279,7 @@ $.showImagesInline = function(urls, thread_id) { }; $.refreshTicketView = function(interval) { - var refresh = - window.ticket_refresh = setInterval(function() { + var refresh = setInterval(function() { if ($('table.list input.ckb[name=tids\\[\\]]:checked').length) // Skip the refresh b/c items are checked return; @@ -291,6 +290,9 @@ $.refreshTicketView = function(interval) { clearInterval(refresh); $.pjax({url: document.location.href, container:'#pjax-container'}); }, interval); + $(document).on('pjax:start', function() { + clearInterval(refresh); + }); }; var ticket_onload = function($) {