Created
January 30, 2016 20:05
-
-
Save Bondifrench/f4bce3795722c5d50a21 to your computer and use it in GitHub Desktop.
A checkbox for Mithril by @JAForbes
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
var checkbox = function checkbox(label, prop) { | |
return m("label.checkbox-inline", m("input[type=checkbox]", { | |
checked: prop(), | |
onclick: m.withAttr("checked", prop) | |
}), _.capitalize(label)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A bootstrap checkbox. Receives a label string and an m.prop() for persistence