mirror of
https://github.com/pebble-dev/clay.git
synced 2026-09-01 06:46:49 -04:00
refactor and add the ability to inject custom code
This commit is contained in:
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user