mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-29 13:26:59 -04:00
refactor components to be in a registry.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user