[ticket/11339] Always clear timeout functions on subsequent AJAX calls

PHPBB3-11339
This commit is contained in:
Cesar G 2013-10-30 19:43:31 -07:00
parent fe768d460d
commit 5cc0f50d28
2 changed files with 3 additions and 2 deletions

View file

@ -26,6 +26,7 @@ phpbb.loadingIndicator = function() {
if (!loadingIndicator.is(':visible')) { if (!loadingIndicator.is(':visible')) {
loadingIndicator.fadeIn(phpbb.alertTime); loadingIndicator.fadeIn(phpbb.alertTime);
// Wait fifteen seconds and display an error if nothing has been returned by then. // Wait fifteen seconds and display an error if nothing has been returned by then.
phpbb.clearLoadingTimeout();
phpbbAlertTimer = setTimeout(function() { phpbbAlertTimer = setTimeout(function() {
if (loadingIndicator.is(':visible')) { if (loadingIndicator.is(':visible')) {
phpbb.alert($('#phpbb_alert').attr('data-l-err'), $('#phpbb_alert').attr('data-l-timeout-processing-req')); 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; refresh = false;
} }
setTimeout(function() { phpbbAlertTimer = setTimeout(function() {
if (refresh) { if (refresh) {
window.location = res.REFRESH_DATA.url; window.location = res.REFRESH_DATA.url;
} }

View file

@ -8,7 +8,7 @@
* @param int Delay in ms until darkenwrapper's click event is triggered * @param int Delay in ms until darkenwrapper's click event is triggered
*/ */
phpbb.closeDarkenWrapper = function(delay) { phpbb.closeDarkenWrapper = function(delay) {
setTimeout(function() { phpbbAlertTimer = setTimeout(function() {
$('#darkenwrapper').trigger('click'); $('#darkenwrapper').trigger('click');
}, delay); }, delay);
}; };