view core/modules/comment/comment-entity-form.es6.js @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 129ea1e6d783
children
line wrap: on
line source
/**
 * @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);