From bd0e98aec2fc8ddb1ad4e9e8ad4dcd42a1a3e85c Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 4 Apr 2013 17:16:30 -0400 Subject: [PATCH] Fix for when category description has html. Could be better. --- .../javascripts/discourse/views/combobox_view_category.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/views/combobox_view_category.js b/app/assets/javascripts/discourse/views/combobox_view_category.js index ff82da6e1f4..f930212b8e6 100644 --- a/app/assets/javascripts/discourse/views/combobox_view_category.js +++ b/app/assets/javascripts/discourse/views/combobox_view_category.js @@ -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 = "" + text + ""; + templateData.text_color + ";'>" + templateData.name + ""; if (templateData.description && templateData.description !== 'null') { - result += '
' + templateData.description + '
'; + result += '
' + Handlebars.Utils.escapeExpression(templateData.description) + '
'; } return result; }