summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/form.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/misc/form.js b/misc/form.js
index 8631ed68c..fd34cd103 100644
--- a/misc/form.js
+++ b/misc/form.js
@@ -12,4 +12,23 @@ Drupal.behaviors.multiselectSelector = {
}
};
+
+/**
+ * Automatically displays the guidelines of the selected text format.
+ */
+Drupal.behaviors.filterGuidelines = {
+ attach: function(context) {
+ $('.filter-guidelines:not(.filterGuidelines-processed)', context)
+ .addClass('filterGuidelines-processed')
+ .find('label').hide()
+ .parents('.filter-wrapper').find('select.filter-list')
+ .bind('change', function() {
+ $(this).parents('.filter-wrapper')
+ .find('.filter-guidelines-item').hide()
+ .siblings('#filter-guidelines-' + this.value).show();
+ })
+ .change();
+ }
+};
+
})(jQuery);