mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 18:56:15 +01:00
updated settings module (v2) to fix multiple selects and checkboxes using name instead of id, which isn't always guaranteed to be set.
This commit is contained in:
@@ -482,14 +482,14 @@ define('settings', function () {
|
|||||||
formEl.find('input[type="checkbox"]').each(function (idx, inputEl) {
|
formEl.find('input[type="checkbox"]').each(function (idx, inputEl) {
|
||||||
inputEl = $(inputEl);
|
inputEl = $(inputEl);
|
||||||
if (!inputEl.is(':checked')) {
|
if (!inputEl.is(':checked')) {
|
||||||
values[inputEl.attr('id')] = 'off';
|
values[inputEl.attr('name')] = 'off';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Normalizing value of multiple selects
|
// Normalizing value of multiple selects
|
||||||
formEl.find('select[multiple]').each(function(idx, selectEl) {
|
formEl.find('select[multiple]').each(function(idx, selectEl) {
|
||||||
selectEl = $(selectEl);
|
selectEl = $(selectEl);
|
||||||
values[selectEl.attr('id')] = JSON.stringify(selectEl.val());
|
values[selectEl.attr('name')] = JSON.stringify(selectEl.val());
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.emit('admin.settings.set', {
|
socket.emit('admin.settings.set', {
|
||||||
|
|||||||
Reference in New Issue
Block a user