FIX: Bugged up Components vs. Views. My original error was using

`templateName` instead of `layoutName` in an `Em.Component`. This fixes
that and backs out other "fixes"
This commit is contained in:
Robin Ward 2014-01-21 13:08:08 -05:00
parent ba74226346
commit a524194a46
3 changed files with 7 additions and 17 deletions

View File

@ -6,15 +6,14 @@
@namespace Discourse
@module Discourse
**/
Discourse.PrivateMessageMapComponent = Ember.View.extend({
templateName: 'components/private-message-map',
Discourse.PrivateMessageMapComponent = Ember.Component.extend({
layoutName: 'components/private-message-map',
tagName: 'section',
classNames: ['information'],
details: Em.computed.alias('topic.details'),
init: function() {
this._super();
this.set('context', this);
},
actions: {
@ -33,7 +32,7 @@ Discourse.PrivateMessageMapComponent = Ember.View.extend({
},
showPrivateInvite: function() {
this.get('controller').send('showPrivateInviteAction');
this.sendAction('showPrivateInviteAction');
}
}

View File

@ -6,18 +6,12 @@
@namespace Discourse
@module Discourse
**/
Discourse.ToggleSummaryComponent = Ember.View.extend({
templateName: 'components/toggle-summary',
Discourse.ToggleSummaryComponent = Ember.Component.extend({
layoutName: 'components/toggle-summary',
tagName: 'section',
classNames: ['information'],
postStream: Em.computed.alias('topic.postStream'),
init: function() {
this._super();
this.set('context', this);
this.set('controller', this);
},
actions: {
toggleSummary: function() {
this.get('postStream').toggleSummary();

View File

@ -9,18 +9,15 @@
var LINKS_SHOWN = 5;
Discourse.TopicMapComponent = Ember.View.extend({
Discourse.TopicMapComponent = Ember.Component.extend({
mapCollapsed: true,
templateName: 'components/topic-map',
layoutName: 'components/topic-map',
details: Em.computed.alias('topic.details'),
allLinksShown: false,
init: function() {
this._super();
this.set('context', this);
this.set('controller', this);
// If the topic has a summary, expand the map by default
this.set('mapCollapsed', Discourse.Mobile.mobileView || (!this.get('topic.has_summary')));
},