refactor and add the ability to inject custom code

This commit is contained in:
Keegan
2015-10-12 01:49:56 -07:00
parent 8c958f1bae
commit 53e49339b5
12 changed files with 65 additions and 82 deletions
+2 -13
View File
@@ -25,22 +25,11 @@ module.exports = {
},
select: {
template: require('../../templates/components/select.mustache'),
manipulator: manipulators.val,
valueTransformer: function(rawValue, item) {
item.options.forEach(function(option, index) {
if (option.value === rawValue) {
item.options[index].selected = 'selected';
}
});
return rawValue;
}
manipulator: manipulators.val
},
toggle: {
template: require('../../templates/components/toggle.mustache'),
manipulator: manipulators.checked,
valueTransformer: function(rawValue) {
return rawValue ? 'checked' : '';
}
manipulator: manipulators.checked
},
submit: {
template: require('../../templates/components/submit.mustache'),