ES6: Topic Message Map converted

This commit is contained in:
Robin Ward 2014-06-02 13:30:35 -04:00
parent f839573d85
commit bf749f127c
5 changed files with 10 additions and 11 deletions

View File

@ -6,7 +6,7 @@
@namespace Discourse
@module Discourse
**/
Discourse.PostGapComponent = Ember.Component.extend({
export default Ember.Component.extend({
classNameBindings: [':gap', 'gap::hidden'],
init: function() {

View File

@ -6,16 +6,12 @@
@namespace Discourse
@module Discourse
**/
Discourse.PrivateMessageMapComponent = Ember.Component.extend({
export default Ember.Component.extend({
layoutName: 'components/private-message-map',
tagName: 'section',
classNames: ['information'],
details: Em.computed.alias('topic.details'),
init: function() {
this._super();
},
actions: {
removeAllowedUser: function(user) {
var self = this;

View File

@ -9,7 +9,7 @@
var LINKS_SHOWN = 5;
Discourse.TopicMapComponent = Ember.Component.extend({
export default Ember.Component.extend({
mapCollapsed: true,
layoutName: 'components/topic-map',
details: Em.computed.alias('topic.details'),

View File

@ -77,7 +77,7 @@
</div>
{{view Discourse.RepliesView content=replies postView=view}}
{{discourse-action-history post=this}}
{{view Discourse.TopicMapContainerView post=this topic=controller.model}}
{{view 'topic-map-container' post=this topic=controller.model}}
</div>
{{post-gutter post=this

View File

@ -7,7 +7,10 @@
@namespace Discourse
@module Discourse
**/
Discourse.TopicMapContainerView = Discourse.ContainerView.extend({
import PrivateMessageMapComponent from 'discourse/components/private-message-map';
import TopicMapComponent from 'discourse/components/topic-map';
export default Discourse.ContainerView.extend({
classNameBindings: ['hidden', ':topic-map'],
shouldRerender: Discourse.View.renderIfChanged('topic.posts_count'),
@ -24,7 +27,7 @@ Discourse.TopicMapContainerView = Discourse.ContainerView.extend({
this._super();
if (this.get('hidden')) return;
this.attachViewWithArgs({ topic: this.get('topic') }, Discourse.TopicMapComponent);
this.attachViewWithArgs({ topic: this.get('topic') }, TopicMapComponent);
this.trigger('appendMapInformation', this);
},
@ -41,7 +44,7 @@ Discourse.TopicMapContainerView = Discourse.ContainerView.extend({
// If we have a private message
if (this.get('topic.isPrivateMessage')) {
container.attachViewWithArgs({ topic: topic, showPrivateInviteAction: 'showPrivateInvite' }, Discourse.PrivateMessageMapComponent);
container.attachViewWithArgs({ topic: topic, showPrivateInviteAction: 'showPrivateInvite' }, PrivateMessageMapComponent);
}
}
});