diff --git a/app/assets/javascripts/discourse/components/topic_information_component.js b/app/assets/javascripts/discourse/components/topic_map_component.js similarity index 73% rename from app/assets/javascripts/discourse/components/topic_information_component.js rename to app/assets/javascripts/discourse/components/topic_map_component.js index f02511f0de8..7d9d3c4366b 100644 --- a/app/assets/javascripts/discourse/components/topic_information_component.js +++ b/app/assets/javascripts/discourse/components/topic_map_component.js @@ -1,7 +1,7 @@ /** - The information that sits in the topic map. + The topic map underneath the first post of a topic. - @class DiscourseTopicInformationComponent + @class DiscourseTopicMapComponent @extends Ember.Component @namespace Discourse @module Discourse @@ -9,12 +9,19 @@ var LINKS_SHOWN = 5; -Discourse.DiscourseTopicInformationComponent = Ember.Component.extend({ +Discourse.DiscourseTopicMapComponent = Ember.Component.extend({ mapCollapsed: true, - templateName: 'components/discourse-topic-information', + templateName: 'components/discourse-topic-map', details: Em.computed.alias('topic.details'), allLinksShown: false, + init: function() { + this._super(); + + // If the topic has a summary, expand the map by default + this.set('mapCollapsed', !this.get('topic.has_summary')); + }, + toggleMapClass: function() { return this.get('mapCollapsed') ? 'icon-chevron-down' : 'icon-chevron-up'; }.property('mapCollapsed'), diff --git a/app/assets/javascripts/discourse/templates/components/discourse-topic-information.js.handlebars b/app/assets/javascripts/discourse/templates/components/discourse-topic-map.js.handlebars similarity index 100% rename from app/assets/javascripts/discourse/templates/components/discourse-topic-information.js.handlebars rename to app/assets/javascripts/discourse/templates/components/discourse-topic-map.js.handlebars diff --git a/app/assets/javascripts/discourse/templates/post.js.handlebars b/app/assets/javascripts/discourse/templates/post.js.handlebars index 6f8c65c1046..d07ccb7e3de 100644 --- a/app/assets/javascripts/discourse/templates/post.js.handlebars +++ b/app/assets/javascripts/discourse/templates/post.js.handlebars @@ -70,7 +70,7 @@ {{view Discourse.RepliesView content=replies postView=view}} {{discourse-action-history post=this}} - {{view Discourse.TopicMapView post=this topic=controller.model}} + {{view Discourse.TopicMapContainerView post=this topic=controller.model}}