FIX: Combobox wasn't matching selected value properly with value of 0

This commit is contained in:
Robin Ward 2014-07-14 15:15:30 -04:00
parent 1886ffaff2
commit ac3827f700

View File

@ -39,7 +39,7 @@ export default Discourse.View.extend({
var self = this;
this.get('content').forEach(function(o) {
var val = o[self.get('valueAttribute')];
if (val) { val = val.toString(); }
if (!Em.isNone(val)) { val = val.toString(); }
var selectedText = (val === selected) ? "selected" : "";
buffer.push("<option " + selectedText + " value=\"" + val + "\" " + self.buildData(o) + ">" + Handlebars.Utils.escapeExpression(Em.get(o, nameProperty)) + "</option>");