mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-28 04:46:57 -04:00
25 lines
563 B
JavaScript
25 lines
563 B
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
name: 'select',
|
|
template: require('../../templates/components/select.tpl'),
|
|
style: require('../../styles/clay/components/select.scss'),
|
|
manipulator: 'val',
|
|
defaults: {
|
|
label: '',
|
|
options: [],
|
|
description: '',
|
|
attributes: {}
|
|
},
|
|
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);
|
|
});
|
|
}
|
|
};
|