diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-11-26 23:56:11 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-11-26 23:56:11 +0100 |
commit | 0f46d35f7548c76f352b55855225a343238809e8 (patch) | |
tree | 0059633698958705491eae3fb14c4d4588d6e3e9 /phpBB/adm | |
parent | b01b3b8b94ed2f77b9855c53d590bd9e3e734278 (diff) | |
download | forums-0f46d35f7548c76f352b55855225a343238809e8.tar forums-0f46d35f7548c76f352b55855225a343238809e8.tar.gz forums-0f46d35f7548c76f352b55855225a343238809e8.tar.bz2 forums-0f46d35f7548c76f352b55855225a343238809e8.tar.xz forums-0f46d35f7548c76f352b55855225a343238809e8.zip |
[ticket/9590] Further deduplicate code for form data
PHPBB3-9590
Diffstat (limited to 'phpBB/adm')
-rw-r--r-- | phpBB/adm/style/ajax.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index e9f03baac3..64670f9d10 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -79,18 +79,18 @@ function submitPermissions() { forumIds = [], permissionSubmitFailed = false; - if ($submitAllButton === $submitButton) { - $.each(fieldsetList, function (key, value) { - if (key % 5 === 0) { - formDataSets[Math.floor(key / 5)] = $form.find('fieldset#' + value.id).serialize(); - } else { - formDataSets[Math.floor(key / 5)] += '&' + $form.find('fieldset#' + value.id).serialize(); - } - }); - } else { - formDataSets[0] = $form.find('fieldset#' + $submitButton.closest('fieldset.permissions').id).serialize(); + if ($submitAllButton !== $submitButton) { + fieldsetList = $form.find('fieldset#' + $submitButton.closest('fieldset.permissions').id); } + $.each(fieldsetList, function (key, value) { + if (key % 5 === 0) { + formDataSets[Math.floor(key / 5)] = $form.find('fieldset#' + value.id).serialize(); + } else { + formDataSets[Math.floor(key / 5)] += '&' + $form.find('fieldset#' + value.id).serialize(); + } + }); + // Add each forum ID to forum ID list to preserve selected forums $.each($form.find('input[type=hidden][name^=forum_id]'), function (key, value) { if (value.name.match(/^forum_id\[([0-9]+)\]$/)) { |