From 5cc0f50d28d4f0866a16848a61978068df642b03 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Wed, 30 Oct 2013 19:43:31 -0700 Subject: [PATCH] [ticket/11339] Always clear timeout functions on subsequent AJAX calls PHPBB3-11339 --- phpBB/assets/javascript/core.js | 3 ++- phpBB/styles/prosilver/template/ajax.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index ac866f7c78..4920a1167f 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -26,6 +26,7 @@ phpbb.loadingIndicator = function() { if (!loadingIndicator.is(':visible')) { loadingIndicator.fadeIn(phpbb.alertTime); // Wait fifteen seconds and display an error if nothing has been returned by then. + phpbb.clearLoadingTimeout(); phpbbAlertTimer = setTimeout(function() { if (loadingIndicator.is(':visible')) { phpbb.alert($('#phpbb_alert').attr('data-l-err'), $('#phpbb_alert').attr('data-l-timeout-processing-req')); @@ -315,7 +316,7 @@ phpbb.ajaxify = function(options) { refresh = false; } - setTimeout(function() { + phpbbAlertTimer = setTimeout(function() { if (refresh) { window.location = res.REFRESH_DATA.url; } diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 4df38f4275..bc68e5ae0c 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -8,7 +8,7 @@ * @param int Delay in ms until darkenwrapper's click event is triggered */ phpbb.closeDarkenWrapper = function(delay) { - setTimeout(function() { + phpbbAlertTimer = setTimeout(function() { $('#darkenwrapper').trigger('click'); }, delay); };