From ce6a3e17cbee9caccdf53fb73343dc40bd0bc603 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 8 Mar 2009 01:43:57 +0000 Subject: #304330 by ximo, alpritt, Amitaibu, edmund.kwok, Xano, ff1, BrightLoudNoise, et al: Dramatically improved text format widget. USABILITY AWESOMENESS. --- misc/form.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'misc') 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); -- cgit v1.2.3