mirror of
https://github.com/discourse/discourse.git
synced 2025-02-18 06:52:44 +08:00
FIX: Combobox wasn't matching selected value properly with value of 0
This commit is contained in:
parent
1886ffaff2
commit
ac3827f700
|
@ -39,7 +39,7 @@ export default Discourse.View.extend({
|
||||||
var self = this;
|
var self = this;
|
||||||
this.get('content').forEach(function(o) {
|
this.get('content').forEach(function(o) {
|
||||||
var val = o[self.get('valueAttribute')];
|
var val = o[self.get('valueAttribute')];
|
||||||
if (val) { val = val.toString(); }
|
if (!Em.isNone(val)) { val = val.toString(); }
|
||||||
|
|
||||||
var selectedText = (val === selected) ? "selected" : "";
|
var selectedText = (val === selected) ? "selected" : "";
|
||||||
buffer.push("<option " + selectedText + " value=\"" + val + "\" " + self.buildData(o) + ">" + Handlebars.Utils.escapeExpression(Em.get(o, nameProperty)) + "</option>");
|
buffer.push("<option " + selectedText + " value=\"" + val + "\" " + self.buildData(o) + ">" + Handlebars.Utils.escapeExpression(Em.get(o, nameProperty)) + "</option>");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user