aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2020-01-30 21:16:37 +0100
committerMarc Alexander <admin@m-a-styles.de>2020-01-30 21:16:37 +0100
commite61761e9af28b838fae3d4231bd3513d73a0f33d (patch)
tree824889fe6557e314bcc4d8216dd986bc12d5c509
parentMerge pull request #5837 from 3D-I/ticket/16337 (diff)
parent[ticket/15370] Loading indicator when submitting permissions (diff)
downloadphpbb-e61761e9af28b838fae3d4231bd3513d73a0f33d.tar.gz
phpbb-e61761e9af28b838fae3d4231bd3513d73a0f33d.tar.bz2
phpbb-e61761e9af28b838fae3d4231bd3513d73a0f33d.zip
Merge pull request #5834 from mrgoldy/ticket/15370
[ticket/15370] Loading indicator when submitting permissions
-rw-r--r--phpBB/adm/style/ajax.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js
index 895bb056e5..9d9fc62254 100644
--- a/phpBB/adm/style/ajax.js
+++ b/phpBB/adm/style/ajax.js
@@ -173,7 +173,9 @@ function submitPermissions() {
var permissionSubmitSize = 0,
permissionRequestCount = 0,
forumIds = [],
- permissionSubmitFailed = false;
+ permissionSubmitFailed = false,
+ clearIndicator = true,
+ $loadingIndicator;
if ($submitAllButton !== $submitButton) {
fieldsetList = $form.find('fieldset#' + $submitButton.closest('fieldset.permissions').id);
@@ -207,6 +209,8 @@ function submitPermissions() {
}
});
+ $loadingIndicator = phpbb.loadingIndicator();
+
/**
* Handler for submitted permissions form chunk
*
@@ -222,6 +226,8 @@ function submitPermissions() {
} else if (!permissionSubmitFailed && res.S_USER_NOTICE) {
// Display success message at the end of submitting the form
if (permissionRequestCount >= permissionSubmitSize) {
+ clearIndicator = true;
+
var $alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
var $alertBoxLink = $alert.find('p.alert_text > a');
@@ -271,6 +277,17 @@ function submitPermissions() {
$form.submit();
}, res.REFRESH_DATA.time * 1000); // Server specifies time in seconds
}
+ } else {
+ // Still more forms to submit, so do not clear indicator
+ clearIndicator = false;
+ }
+ }
+
+ if (clearIndicator) {
+ phpbb.clearLoadingTimeout();
+
+ if ($loadingIndicator) {
+ $loadingIndicator.fadeOut(phpbb.alertTime);
}
}
}