Skip to content
Snippets Groups Projects

#3411291 Fix ESLint findings

Merged NISHANT THAKUR requested to merge issue/fragments-3411291:3411291-fix-eslint-errors into 2.x
Files
2
+ 23
21
@@ -3,9 +3,7 @@
* Behaviors for setting summaries on fragment form.
*/
(function ($, Drupal) {
'use strict';
(($, Drupal) => {
/**
* @type {Drupal~behavior}
*
@@ -13,28 +11,32 @@
* Attaches summary behaviors on content type edit forms.
*/
Drupal.behaviors.fragmentForm = {
attach: function (context) {
var $context = $(context);
attach(context) {
const $context = $(context);
$context.find('.fragment-form-publishing-status').drupalSetSummary(function (context) {
var $statusContext = $(context);
var statusCheckbox = $statusContext.find('#edit-status-value');
$context
.find('.fragment-form-publishing-status')
.drupalSetSummary((context) => {
const $statusContext = $(context);
const statusCheckbox = $statusContext.find('#edit-status-value');
if (statusCheckbox.is(':checked')) {
return Drupal.t('Published');
}
if (statusCheckbox.is(':checked')) {
return Drupal.t('Published');
}
return Drupal.t('Not published');
});
return Drupal.t('Not published');
});
$context.find('.fragment-form-authoring-information').drupalSetSummary(function (context) {
var $authorContext = $(context);
var authorField = $authorContext.find('input');
$context
.find('.fragment-form-authoring-information')
.drupalSetSummary((context) => {
const $authorContext = $(context);
const authorField = $authorContext.find('input');
if (authorField.val().length) {
return authorField.val();
}
});
}
if (authorField.val().length) {
return authorField.val();
}
});
},
};
})(jQuery, Drupal);
Loading