mirror of
https://github.com/pebble-dev/clay.git
synced 2026-10-28 07:29:59 -04:00
refactor and add the ability to inject custom code
This commit is contained in:
1 parent
8c958f1bae
commit
53e49339b5
12 files changed
+65
-82
No files matched your search
@@ -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