refactor components to be in a registry.

This commit is contained in:
Keegan
2016-02-01 14:56:47 -08:00
parent 7e3dbfa148
commit bca1975d8e
22 changed files with 126 additions and 94 deletions
+21
View File
@@ -0,0 +1,21 @@
'use strict';
module.exports = {
name: 'select',
template: require('../../templates/items/select.tpl'),
manipulator: require('../lib/manipulators').val,
defaults: {
label: '',
options: []
},
initialize: function() {
var self = this;
var $value = self.$element.select('.value');
self.on('change', function(ev) {
var value = self.$manipulatorTarget.select('option:checked').get('innerHTML');
$value.set('innerHTML', value);
});
}
};