This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/web/core/modules/comment/comment-entity-form.es6.js
2018-11-23 12:29:20 +00:00

27 lines
568 B
JavaScript

/**
* @file
* Attaches comment behaviors to the entity form.
*/
(function($, Drupal) {
/**
*
* @type {Drupal~behavior}
*/
Drupal.behaviors.commentFieldsetSummaries = {
attach(context) {
const $context = $(context);
$context
.find('fieldset.comment-entity-settings-form')
.drupalSetSummary(context =>
Drupal.checkPlain(
$(context)
.find('.js-form-item-comment input:checked')
.next('label')
.text(),
),
);
},
};
})(jQuery, Drupal);