summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAlex Pott <alex.a.pott@googlemail.com>2018-07-06 12:18:34 +0100
committerAlex Pott <alex.a.pott@googlemail.com>2018-07-06 12:18:34 +0100
commite4b5fe2ef8f702f2ba9085a15486aea71b15256d (patch)
tree502bb8ca796c08fe17ff1dbf75a4bc5af3d578b2
parent6ae83e17664cc5f19809b7c4ced4f00f43257946 (diff)
downloaddrupal-e4b5fe2ef8f702f2ba9085a15486aea71b15256d.tar.gz
drupal-e4b5fe2ef8f702f2ba9085a15486aea71b15256d.zip
Issue #2983375 by m1r1k, ApacheEx, drpal: JS codestyle: function-paren-newline
-rw-r--r--core/.eslintrc.passing.json1
-rw-r--r--core/misc/tabledrag.es6.js17
-rw-r--r--core/misc/vertical-tabs.es6.js8
-rw-r--r--core/modules/color/color.es6.js12
-rw-r--r--core/modules/contextual/js/contextual.es6.js7
-rw-r--r--core/modules/field_ui/field_ui.es6.js3
-rw-r--r--core/modules/quickedit/js/quickedit.es6.js3
7 files changed, 29 insertions, 22 deletions
diff --git a/core/.eslintrc.passing.json b/core/.eslintrc.passing.json
index abb9a63c1f0f..3ee572f109c2 100644
--- a/core/.eslintrc.passing.json
+++ b/core/.eslintrc.passing.json
@@ -12,7 +12,6 @@
"no-restricted-globals": "off",
"react/no-this-in-sfc": "off",
"react/destructuring-assignment": "off",
- "function-paren-newline": "off",
"implicit-arrow-linebreak": "off",
"import/named": "off",
"spaced-comment": "off"
diff --git a/core/misc/tabledrag.es6.js b/core/misc/tabledrag.es6.js
index 93cc0349c23e..6105aeeae6e6 100644
--- a/core/misc/tabledrag.es6.js
+++ b/core/misc/tabledrag.es6.js
@@ -211,14 +211,15 @@
});
// Add a link before the table for users to show or hide weight columns.
- $table.before($('<button type="button" class="link tabledrag-toggle-weight"></button>')
- .attr('title', Drupal.t('Re-order rows by numerical weight instead of dragging.'))
- .on('click', $.proxy(function (e) {
- e.preventDefault();
- this.toggleColumns();
- }, this))
- .wrap('<div class="tabledrag-toggle-weight-wrapper"></div>')
- .parent(),
+ $table.before(
+ $('<button type="button" class="link tabledrag-toggle-weight"></button>')
+ .attr('title', Drupal.t('Re-order rows by numerical weight instead of dragging.'))
+ .on('click', $.proxy(function (e) {
+ e.preventDefault();
+ this.toggleColumns();
+ }, this))
+ .wrap('<div class="tabledrag-toggle-weight-wrapper"></div>')
+ .parent(),
);
// Initialize the specified columns (for example, weight or parent columns)
diff --git a/core/misc/vertical-tabs.es6.js b/core/misc/vertical-tabs.es6.js
index 61ea218709ef..c0427bbf78bc 100644
--- a/core/misc/vertical-tabs.es6.js
+++ b/core/misc/vertical-tabs.es6.js
@@ -270,10 +270,10 @@
Drupal.theme.verticalTab = function (settings) {
const tab = {};
tab.item = $('<li class="vertical-tabs__menu-item" tabindex="-1"></li>')
- .append(tab.link = $('<a href="#"></a>')
- .append(tab.title = $('<strong class="vertical-tabs__menu-item-title"></strong>').text(settings.title))
- .append(tab.summary = $('<span class="vertical-tabs__menu-item-summary"></span>'),
- ),
+ .append(
+ tab.link = $('<a href="#"></a>')
+ .append(tab.title = $('<strong class="vertical-tabs__menu-item-title"></strong>').text(settings.title))
+ .append(tab.summary = $('<span class="vertical-tabs__menu-item-summary"></span>')),
);
return tab;
};
diff --git a/core/modules/color/color.es6.js b/core/modules/color/color.es6.js
index 01939a1f65aa..809c15e09cd0 100644
--- a/core/modules/color/color.es6.js
+++ b/core/modules/color/color.es6.js
@@ -252,19 +252,23 @@
e.preventDefault();
if (toggleClick) {
$(this).addClass('is-unlocked').html(Drupal.t('Lock'));
- $(hooks[i - 1]).attr('class',
+ $(hooks[i - 1]).attr(
+ 'class',
locks[i - 2] && $(locks[i - 2]).is(':not(.is-unlocked)') ? 'color-palette__hook is-up' : 'color-palette__hook',
);
- $(hooks[i]).attr('class',
+ $(hooks[i]).attr(
+ 'class',
locks[i] && $(locks[i]).is(':not(.is-unlocked)') ? 'color-palette__hook is-down' : 'color-palette__hook',
);
}
else {
$(this).removeClass('is-unlocked').html(Drupal.t('Unlock'));
- $(hooks[i - 1]).attr('class',
+ $(hooks[i - 1]).attr(
+ 'class',
locks[i - 2] && $(locks[i - 2]).is(':not(.is-unlocked)') ? 'color-palette__hook is-both' : 'color-palette__hook is-down',
);
- $(hooks[i]).attr('class',
+ $(hooks[i]).attr(
+ 'class',
locks[i] && $(locks[i]).is(':not(.is-unlocked)') ? 'color-palette__hook is-both' : 'color-palette__hook is-up',
);
}
diff --git a/core/modules/contextual/js/contextual.es6.js b/core/modules/contextual/js/contextual.es6.js
index 8e05f87ae3ac..d3e5973440f6 100644
--- a/core/modules/contextual/js/contextual.es6.js
+++ b/core/modules/contextual/js/contextual.es6.js
@@ -4,7 +4,8 @@
*/
(function ($, Drupal, drupalSettings, _, Backbone, JSON, storage) {
- const options = $.extend(drupalSettings.contextual,
+ const options = $.extend(
+ drupalSettings.contextual,
// Merge strings on top of drupalSettings so that they are not mutable.
{
strings: {
@@ -109,8 +110,8 @@
aural: new contextual.AuralView(viewOptions),
keyboard: new contextual.KeyboardView(viewOptions),
});
- contextual.regionViews.push(new contextual.RegionView(
- $.extend({ el: $region, model }, options)),
+ contextual.regionViews.push(
+ new contextual.RegionView($.extend({ el: $region, model }, options)),
);
// Add the model to the collection. This must happen after the views have
diff --git a/core/modules/field_ui/field_ui.es6.js b/core/modules/field_ui/field_ui.es6.js
index cf1284171186..bed88de05249 100644
--- a/core/modules/field_ui/field_ui.es6.js
+++ b/core/modules/field_ui/field_ui.es6.js
@@ -22,7 +22,8 @@
$form.find(
'.js-form-item-label label,' +
'.js-form-item-field-name label,' +
- '.js-form-item-existing-storage-label label')
+ '.js-form-item-existing-storage-label label',
+ )
.addClass('js-form-required form-required');
const $newFieldType = $form.find('select[name="new_storage_type"]');
diff --git a/core/modules/quickedit/js/quickedit.es6.js b/core/modules/quickedit/js/quickedit.es6.js
index 145c26dc1a94..06e6d53dc760 100644
--- a/core/modules/quickedit/js/quickedit.es6.js
+++ b/core/modules/quickedit/js/quickedit.es6.js
@@ -18,7 +18,8 @@
*/
(function ($, _, Backbone, Drupal, drupalSettings, JSON, storage) {
- const options = $.extend(drupalSettings.quickedit,
+ const options = $.extend(
+ drupalSettings.quickedit,
// Merge strings on top of drupalSettings so that they are not mutable.
{
strings: {