diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2013-01-02 16:56:38 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2013-01-02 16:56:38 -0500 |
commit | 300b8236eb8d08603207e01498a98abcc43cce1b (patch) | |
tree | 80c7f2b1da9638ca1ae58f97a247462752bc79bc /phpBB/assets/javascript/core.js | |
parent | 56a7dd2bd5bf868bc68d6594d94dd0ae0c4d1531 (diff) | |
parent | 48b6e45f7cee93dcbcc3b9b3ca857a4ed8f07437 (diff) | |
download | forums-300b8236eb8d08603207e01498a98abcc43cce1b.tar forums-300b8236eb8d08603207e01498a98abcc43cce1b.tar.gz forums-300b8236eb8d08603207e01498a98abcc43cce1b.tar.bz2 forums-300b8236eb8d08603207e01498a98abcc43cce1b.tar.xz forums-300b8236eb8d08603207e01498a98abcc43cce1b.zip |
Merge PR #1153 branch 'marc1706/ticket/10805' into develop
# By Marc Alexander
# Via Marc Alexander
* marc1706/ticket/10805:
[ticket/10805] Compare phpbbAlertTimer against null
[ticket/10805] Clear loading alert timeout after ajax request finished
Diffstat (limited to 'phpBB/assets/javascript/core.js')
-rw-r--r-- | phpBB/assets/javascript/core.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index a4f7455b01..30c0a199bf 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -13,6 +13,7 @@ var keymap = { var dark = $('#darkenwrapper'); var loading_alert = $('#loadingalert'); +var phpbbAlertTimer = null; /** @@ -30,7 +31,7 @@ phpbb.loading_alert = function() { loading_alert.show(); dark.fadeIn(phpbb.alert_time, function() { // Wait five seconds and display an error if nothing has been returned by then. - setTimeout(function() { + phpbbAlertTimer = setTimeout(function() { if (loading_alert.is(':visible')) { phpbb.alert($('#phpbb_alert').attr('data-l-err'), $('#phpbb_alert').attr('data-l-timeout-processing-req')); @@ -43,6 +44,16 @@ phpbb.loading_alert = function() { } /** + * Clear loading alert timeout +*/ +phpbb.clearLoadingTimeout = function() { + if (phpbbAlertTimer != null) { + clearTimeout(phpbbAlertTimer); + phpbbAlertTimer = null; + } +} + +/** * Display a simple alert similar to JSs native alert(). * * You can only call one alert or confirm box at any one time. @@ -271,6 +282,8 @@ phpbb.ajaxify = function(options) { { var alert; + phpbb.clearLoadingTimeout(); + // Is a confirmation required? if (typeof res.S_CONFIRM_ACTION === 'undefined') { @@ -341,6 +354,7 @@ phpbb.ajaxify = function(options) { { var alert; + phpbb.clearLoadingTimeout(); alert = phpbb.alert(dark.attr('data-ajax-error-title'), dark.attr('data-ajax-error-text')); } |