Skip to content

Instantly share code, notes, and snippets.

@Bondifrench
Created January 30, 2016 20:03
Show Gist options
  • Save Bondifrench/56d27c79a6085d7b353b to your computer and use it in GitHub Desktop.
Save Bondifrench/56d27c79a6085d7b353b to your computer and use it in GitHub Desktop.
Tabset for Mithril by @JAForbes
var tabset = function tabset(tabnames, active) {
return m("ul", { className: "nav nav-tabs" }, tabnames.map(function (tab) {
return m("li", { role: "presentation", className: tab == active() && "active" }, m("a", { onclick: function onclick() {
return active(tab);
} }, tab));
}));
};
@Bondifrench
Copy link
Author

A bootstrap tabset. Receives a list of tab names, and an m.prop()

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