diff --git a/app/assets/javascripts/discourse/components/category-select-box.js.es6 b/app/assets/javascripts/discourse/components/category-select-box.js.es6
index d411e2e8a09..9be9c3e689f 100644
--- a/app/assets/javascripts/discourse/components/category-select-box.js.es6
+++ b/app/assets/javascripts/discourse/components/category-select-box.js.es6
@@ -74,7 +74,6 @@ export default SelectBoxComponent.extend({
rowContentTemplate(item) {
let category;
- let result = '
';
// If we have no id, but text with the uncategorized name, we can use that badge.
if (Ember.isEmpty(item.id)) {
@@ -87,18 +86,20 @@ export default SelectBoxComponent.extend({
}
if (!category) return item.text;
- result += categoryBadgeHTML(category, {link: false, allowUncategorized: true, hideParent: true});
+ let result = categoryBadgeHTML(category, {link: false, allowUncategorized: true, hideParent: true});
const parentCategoryId = category.get("parent_category_id");
if (parentCategoryId) {
- result += categoryBadgeHTML(Category.findById(parentCategoryId), {link: false}) + " " + result;
+ result = `
${categoryBadgeHTML(Category.findById(parentCategoryId), {link: false})} ${result}`;
+ } else {
+ result = `
${result}`;
}
- result += ` × ${category.get("topic_count")}
`;
+ result += `
× ${category.get("topic_count")}`;
const description = category.get("description");
// TODO wtf how can this be null?;
- if (description && description !== 'null') {
+ if (description && description !== "null") {
result += `
${description.substr(0, 200)}${description.length > 200 ? '…' : ''}
`;
}