Skip to content

Instantly share code, notes, and snippets.

@EdwardIrby
Created June 6, 2014 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EdwardIrby/fd1838891a41b43520ff to your computer and use it in GitHub Desktop.
Save EdwardIrby/fd1838891a41b43520ff to your computer and use it in GitHub Desktop.
Ractive Flex Input Component v 0.1
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