Skip to content
Snippets Groups Projects
Commit 29a2728e authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #2983377 by ApacheEx, anmolgoyal74, drpal, m1r1k: JS codestyle: implicit-arrow-linebreak

parent 25809ca8
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,6 @@
"operator-linebreak": "off",
"react/no-this-in-sfc": "off",
"react/destructuring-assignment": "off",
"implicit-arrow-linebreak": "off",
"import/named": "off"
}
}
......@@ -154,10 +154,11 @@
* Array of IDs for form fields.
*/
function fieldsList(form) {
const $fieldList = $(form).find('[name]').map((index, element) =>
const $fieldList = $(form).find('[name]').map(
// We use id to avoid name duplicates on radio fields and filter out
// elements with a name but no id.
element.getAttribute('id'));
(index, element) => element.getAttribute('id'),
);
// Return a true array.
return $.makeArray($fieldList);
}
......
......@@ -136,13 +136,17 @@
// Calculate minimum weight.
let weight = -Math.round(table.find('.draggable').length / 2);
// Update the block weights.
table.find(`.region-${region}-message`).nextUntil('.region-title')
.find('select.block-weight').val(() =>
table
.find(`.region-${region}-message`)
.nextUntil('.region-title')
.find('select.block-weight')
.val(
// Increment the weight before assigning it to prevent using the
// absolute minimum available weight. This way we always have an
// unused upper and lower bound, which makes manually setting the
// weights easier for users who prefer to do it that way.
++weight);
() => ++weight,
);
}
const table = $('#blocks');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment