From 671939b0d6b1054688c1c4285c9cd124e0bb80dd Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Wed, 9 Apr 2014 20:55:12 -0500
Subject: [PATCH] pjax: Cancel outstanding timeouts when pjax starts

---
 scp/js/scp.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scp/js/scp.js b/scp/js/scp.js
index 564f69e41..f59084e47 100644
--- a/scp/js/scp.js
+++ b/scp/js/scp.js
@@ -637,6 +637,11 @@ getConfig = (function() {
 $(document).on('pjax:start', function() {
     clearInterval(window.ticket_refresh);
     $('#loading').show().css({opacity:0.7});
+    // Clear all timeouts
+    var id = window.setTimeout(function() {}, 0);
+    while (id--) {
+      window.clearTimeout(id);
+    }
 });
 $(document).on('pjax:complete', function() {
     $('#loading').hide().css({opacity:1});
-- 
GitLab