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

This commit is contained in:
Keegan committed 2016-03-08 08:28:29 +11:00
commit 061bb34c91
6 files changed
+138 -31

No files matched your search

+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);
}
};