mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 20:54:00 -06:00
Fix for when category description has html. Could be better.
This commit is contained in:
parent
d974aea536
commit
bd0e98aec2
@ -10,16 +10,15 @@ Discourse.ComboboxViewCategory = Discourse.ComboboxView.extend({
|
||||
none: 'category.none',
|
||||
classNames: ['combobox category-combobox'],
|
||||
overrideWidths: true,
|
||||
dataAttributes: ['color', 'text_color', 'description'],
|
||||
dataAttributes: ['name', 'color', 'text_color', 'description'],
|
||||
valueBinding: Ember.Binding.oneWay('source'),
|
||||
|
||||
template: function(text, templateData) {
|
||||
if (!templateData.color) return text;
|
||||
|
||||
var result = "<span class='badge-category' style='background-color: #" + templateData.color + '; color: #' +
|
||||
templateData.text_color + ";' >" + text + "</span>";
|
||||
templateData.text_color + ";'>" + templateData.name + "</span>";
|
||||
if (templateData.description && templateData.description !== 'null') {
|
||||
result += '<div class="category-desc">' + templateData.description + '</div>';
|
||||
result += '<div class="category-desc">' + Handlebars.Utils.escapeExpression(templateData.description) + '</div>';
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user