Skip to content

Instantly share code, notes, and snippets.

@akkonrad
Created March 18, 2015 16:01
Show Gist options
  • Save akkonrad/ed45079a75122d3fe682 to your computer and use it in GitHub Desktop.
Save akkonrad/ed45079a75122d3fe682 to your computer and use it in GitHub Desktop.
Collapsible bug in Bootstrap based themes (Drupal).
// Place in theme file, eg. mytheme/js/script.js
(function($, Drupal, window, document, undefined) {
Drupal.behaviors.bootstrap_based_theme = {
attach : function(context, settings) {
// Fix collapsible bug.
$(".collapse").on("hidden.bs.collapse", function() {
if ($(this).hasClass("in")) {
$(this).removeClass("in");
}
});
}
};
})(jQuery, Drupal, this, this.document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment