From a75eda1db26059e9347c9ade464952230d3e2859 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Thu, 6 Aug 2015 04:53:31 -0500 Subject: [PATCH] tickets: Fix refresh after navigation from listing --- scp/js/scp.js | 2 -- scp/js/ticket.js | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scp/js/scp.js b/scp/js/scp.js index 1b9327b52..58ced5d33 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 9dc493ad8..897fafa8e 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($) { -- GitLab