Skip to content

Instantly share code, notes, and snippets.

@Cyclodex
Created October 4, 2016 14:06
Show Gist options
  • Save Cyclodex/d5f932a5ba8217f1504a67930d602c72 to your computer and use it in GitHub Desktop.
Save Cyclodex/d5f932a5ba8217f1504a67930d602c72 to your computer and use it in GitHub Desktop.
Drupal JS behaviour: Hide text format information, openable on "more info" link.
(function ($) {
Drupal.behaviors.TextFormatImprovments = {
attach: function (context, settings) {
// help removing the text-markup infos
// hide all guides and also the text formatter selection
$('.form-type-select', '.text-format-wrapper').hide();
$('.filter-guidelines', '.text-format-wrapper').hide();
// make the info link opening the guides
var FilterGuidesLink = $('.filter-help', '.text-format-wrapper');
FilterGuidesLink.click(function(e){
e.preventDefault();
$(this).next('.form-type-select').slideToggle();
$(this).nextAll('.filter-guidelines').slideToggle();
});
}
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment