Commit e0feb5b1 authored by lauriii's avatar lauriii Committed by alexpott

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

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