summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/comment/comment-entity-form.js
diff options
context:
space:
mode:
authorAlex Pott <alex.a.pott@googlemail.com>2013-09-27 17:34:47 +0200
committerAlex Pott <alex.a.pott@googlemail.com>2013-09-27 17:34:47 +0200
commit37949fe37843eed62b09aba8f2612e832df2953e (patch)
tree960dbe703d25f2d501bd16b15e56fb5bf241d68f /core/modules/comment/comment-entity-form.js
parentfb091cd6b5531bca2ef06c3b5972197c87bba704 (diff)
downloaddrupal-37949fe37843eed62b09aba8f2612e832df2953e.tar.gz
drupal-37949fe37843eed62b09aba8f2612e832df2953e.zip
Issue #731724 by larowlan, andypost, dixon_, tsvenson: Convert comment settings into a field to make them work with CMI and non-node entities.
Diffstat (limited to 'core/modules/comment/comment-entity-form.js')
-rw-r--r--core/modules/comment/comment-entity-form.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/modules/comment/comment-entity-form.js b/core/modules/comment/comment-entity-form.js
new file mode 100644
index 00000000000..e068ef51d26
--- /dev/null
+++ b/core/modules/comment/comment-entity-form.js
@@ -0,0 +1,19 @@
+/**
+ * @file
+ * Attaches comment behaviors to the entity form.
+ */
+
+(function ($) {
+
+"use strict";
+
+Drupal.behaviors.commentFieldsetSummaries = {
+ attach: function (context) {
+ var $context = $(context);
+ $context.find('fieldset.comment-entity-settings-form').drupalSetSummary(function (context) {
+ return Drupal.checkPlain($(context).find('.form-item-comment input:checked').next('label').text());
+ });
+ }
+};
+
+})(jQuery);