From 6c30e0b09cc20b1ae6aa7ca6c2b467a1a4b3383a Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 26 Feb 2013 12:17:23 -0500 Subject: [PATCH] Add 'descrption' to categories, even when in a Combobox --- .../javascripts/discourse/templates/topic.js.handlebars | 2 +- .../discourse/views/combobox_view_category.js | 9 +++++++-- app/assets/javascripts/discourse/views/topic_view.js | 1 - 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/topic.js.handlebars b/app/assets/javascripts/discourse/templates/topic.js.handlebars index df6107c60..419fbb914 100644 --- a/app/assets/javascripts/discourse/templates/topic.js.handlebars +++ b/app/assets/javascripts/discourse/templates/topic.js.handlebars @@ -10,7 +10,7 @@ {{/if}} {{#if view.editingTopic}} - {{view Discourse.ComboboxViewCategory valueAttribute="name" contentBinding="view.categories" valueBinding="view.topic.categoryName"}} + {{view Discourse.ComboboxViewCategory valueAttribute="name" contentBinding="Discourse.site.categories" valueBinding="view.topic.categoryName"}} {{else}} diff --git a/app/assets/javascripts/discourse/views/combobox_view_category.js b/app/assets/javascripts/discourse/views/combobox_view_category.js index ef97fa7a4..e295a59a1 100644 --- a/app/assets/javascripts/discourse/views/combobox_view_category.js +++ b/app/assets/javascripts/discourse/views/combobox_view_category.js @@ -8,11 +8,16 @@ **/ Discourse.ComboboxViewCategory = Discourse.ComboboxView.extend({ none: 'category.none', - dataAttributes: ['color'], + dataAttributes: ['color', 'description'], template: function(text, templateData) { if (!templateData.color) return text; - return "" + text + ""; + + var result = "" + text + ""; } }); diff --git a/app/assets/javascripts/discourse/views/topic_view.js b/app/assets/javascripts/discourse/views/topic_view.js index 9da147f19..577373266 100644 --- a/app/assets/javascripts/discourse/views/topic_view.js +++ b/app/assets/javascripts/discourse/views/topic_view.js @@ -13,7 +13,6 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, { userFiltersBinding: 'controller.userFilters', classNameBindings: ['controller.multiSelect:multi-select', 'topic.archetype'], siteBinding: 'Discourse.site', - categoriesBinding: 'site.categories', progressPosition: 1, menuVisible: true, SHORT_POST: 1200,