mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-29 05:16:32 -04:00
Merge remote-tracking branch 'origin/master' into #31/generic-btn-component
This commit is contained in:
@@ -16,11 +16,18 @@ module.exports = {
|
||||
|
||||
var $value = self.$element.select('.value');
|
||||
|
||||
self.on('change', function() {
|
||||
/**
|
||||
* Updates the HTML value of the component to match the slected option's label
|
||||
* @return {void}
|
||||
*/
|
||||
function setValueDisplay() {
|
||||
var selectedIndex = self.$manipulatorTarget.get('selectedIndex');
|
||||
var $options = self.$manipulatorTarget.select('option');
|
||||
var value = $options[selectedIndex] && $options[selectedIndex].innerHTML;
|
||||
$value.set('innerHTML', value);
|
||||
});
|
||||
}
|
||||
|
||||
setValueDisplay();
|
||||
self.on('change', setValueDisplay);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user