This commit is contained in:
Keegan
2015-11-12 09:42:18 -08:00
parent 0aef0caf79
commit d47db97bb6
6 changed files with 48 additions and 7 deletions
+4
View File
@@ -31,6 +31,10 @@ module.exports = {
template: require('../../templates/components/toggle.mustache'),
manipulator: manipulators.checked
},
radiogroup: {
template: require('../../templates/components/radiogroup.mustache'),
manipulator: manipulators.radiogroup
},
submit: {
template: require('../../templates/components/submit.mustache'),
manipulator: manipulators.val
+18
View File
@@ -43,5 +43,23 @@ module.exports = {
return this.$manipulatorTarget.prop('disabled', false)
.triggerHandler('change');
}
},
radiogroup: {
get: function() {
return this.$manipulatorTarget.find('input:checked').val();
},
set: function(value) {
this.$manipulatorTarget.find('[value="' + value + '"]')
.prop('checked', true);
return this.$manipulatorTarget.triggerHandler('change');
},
disable: function() {
return this.$manipulatorTarget.prop('disabled', true)
.triggerHandler('change');
},
enable: function() {
return this.$manipulatorTarget.prop('disabled', false)
.triggerHandler('change');
}
}
};