Created
June 6, 2014 21:51
-
-
Save EdwardIrby/fd1838891a41b43520ff to your computer and use it in GitHub Desktop.
Ractive Flex Input Component v 0.1
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
Ractive.partials.selectbox= require("../selectbox/selectbox.html"); | |
var flexinputs ={ | |
Input:require("./layouts/Input.html"), | |
InputAnchor:require("./layouts/InputAnchor.html"), | |
InputButton:require("./layouts/InputButton.html"), | |
InputSlectbox:require("./layouts/InputSelect.html"), | |
InputSelectboxAnchor:require("./layouts/InputSelectAnchor.html"), | |
InputSelectboxButton:require("./layouts/InputSelectButton.html"), | |
Selectbox:require("./layouts/Select.html"), | |
TripleSelect:require("./layouts/TripleSelect.html"), | |
Nested:require("./layouts/nested.html"), | |
} | |
var ractiveFlexInput = Ractive.extend({ | |
type:null, | |
template:require("./base.html"), | |
partials:{}, | |
beforeInit:function(options){ | |
this.setPartial(options); | |
}, | |
setPartial:function(options){ | |
var type = options.data.type | |
options.partials.type = flexinputs[type]; | |
console.log( options.partials.type); | |
} | |
}); | |
Ractive.components.flexinput= ractiveFlexInput |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment