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 @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.PostGapComponent = Ember.Component.extend({ export default Ember.Component.extend({
classNameBindings: [':gap', 'gap::hidden'], classNameBindings: [':gap', 'gap::hidden'],
init: function() { init: function() {

View File

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

View File

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

View File

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

View File

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