Don't recalculate trustLevels combobox
This commit is contained in:
parent
62d161fd70
commit
0c7ead339b
|
@ -67,10 +67,8 @@ Discourse.AdminUser = Discourse.User.extend({
|
|||
},
|
||||
|
||||
trustLevels: function() {
|
||||
return Discourse.Site.instance().get('trustLevels').map(function (tl) {
|
||||
return {id: tl.get('id'), name: tl.get('detailedName') };
|
||||
});
|
||||
}.property('trust_level'),
|
||||
return Discourse.Site.instance().get('trustLevels');
|
||||
}.property(),
|
||||
|
||||
dirty: Discourse.computed.propertyNotEqual('originalTrustLevel', 'trustLevel.id'),
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
<div class='display-row'>
|
||||
<div class='field'>{{i18n trust_level}}</div>
|
||||
<div class="value">
|
||||
{{combobox content=trustLevels value=trust_level }}
|
||||
{{combobox content=trustLevels value=trust_level nameProperty="detailedName"}}
|
||||
</div>
|
||||
<div class="controls">
|
||||
{{#if dirty}}
|
||||
|
|
|
@ -13,6 +13,8 @@ Discourse.ComboboxView = Discourse.View.extend({
|
|||
|
||||
render: function(buffer) {
|
||||
|
||||
var nameProperty = this.get('nameProperty') || 'name';
|
||||
|
||||
// Add none option if required
|
||||
if (this.get('none')) {
|
||||
buffer.push('<option value="">' + (I18n.t(this.get('none'))) + "</option>");
|
||||
|
@ -33,10 +35,10 @@ Discourse.ComboboxView = Discourse.View.extend({
|
|||
var data = "";
|
||||
if (comboboxView.dataAttributes) {
|
||||
comboboxView.dataAttributes.forEach(function(a) {
|
||||
data += "data-" + a + "=\"" + (o.get(a)) + "\" ";
|
||||
data += "data-" + a + "=\"" + o.get(a) + "\" ";
|
||||
});
|
||||
}
|
||||
buffer.push("<option " + selectedText + " value=\"" + val + "\" " + data + ">" + o.name + "</option>");
|
||||
buffer.push("<option " + selectedText + " value=\"" + val + "\" " + data + ">" + Em.get(o, nameProperty) + "</option>");
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue