Merge remote-tracking branch 'origin/master' into #31/generic-btn-component

This commit is contained in:
Keegan
2016-03-08 08:28:29 +11:00
6 changed files with 138 additions and 31 deletions
+9 -2
View File
@@ -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);
}
};