1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-19 15:17:16 +01:00

[ticket/15370] Loading indicator when submitting permissions

PHPBB3-15370
This commit is contained in:
mrgoldy 2020-01-21 15:27:28 +01:00
parent 880deabac1
commit 908d04d0e8

View File

@ -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);
}
}
}