Created
October 4, 2016 14:06
-
-
Save Cyclodex/d5f932a5ba8217f1504a67930d602c72 to your computer and use it in GitHub Desktop.
Drupal JS behaviour: Hide text format information, openable on "more info" link.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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