Version 1
[yaffs-website] / web / core / modules / comment / comment-entity-form.js
diff --git a/web/core/modules/comment/comment-entity-form.js b/web/core/modules/comment/comment-entity-form.js
new file mode 100644 (file)
index 0000000..fd16d8b
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * @file
+ * Attaches comment behaviors to the entity form.
+ */
+
+(function ($, Drupal) {
+
+  'use strict';
+
+  /**
+   *
+   * @type {Drupal~behavior}
+   */
+  Drupal.behaviors.commentFieldsetSummaries = {
+    attach: function (context) {
+      var $context = $(context);
+      $context.find('fieldset.comment-entity-settings-form').drupalSetSummary(function (context) {
+        return Drupal.checkPlain($(context).find('.js-form-item-comment input:checked').next('label').text());
+      });
+    }
+  };
+
+})(jQuery, Drupal);