Created
January 30, 2016 20:03
-
-
Save Bondifrench/56d27c79a6085d7b353b to your computer and use it in GitHub Desktop.
Tabset for Mithril by @JAForbes
This file contains hidden or 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
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)); | |
})); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A bootstrap tabset. Receives a list of tab names, and an m.prop()