Skip to content

Instantly share code, notes, and snippets.

@krishan
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save krishan/fba5b2654167d261f07b to your computer and use it in GitHub Desktop.

Select an option

Save krishan/fba5b2654167d261f07b to your computer and use it in GitHub Desktop.
make first bootstrap tabs active by default in scrivito
// make the first tab of each bootstrap tab panel active
scrivito.on("content", function(content) {
// explanation of find & addBack usage see:
// http://stackoverflow.com/questions/2828019
$(content).
find("[role=tabpanel]").addBack("[role=tabpanel]").
each(function(_, panel) {
$(panel).find(".nav-tabs > *:first").addClass("active");
$(panel).find(".tab-content > *:first").addClass("active");
});
});
@agessler
Copy link
Copy Markdown

agessler commented Dec 5, 2014

looks fine to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment