From 8c32f22ae069c50912dd132f582f76fcdff04ad8 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 20 Jan 2014 17:12:37 -0500 Subject: [PATCH] FIX: Adding components to a ContainerView doesn't set the context properly. --- .../discourse/components/private_message_map_component.js | 8 +++++++- .../components/private-message-map.js.handlebars | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/components/private_message_map_component.js b/app/assets/javascripts/discourse/components/private_message_map_component.js index 1c4191831ff..26157e5b4db 100644 --- a/app/assets/javascripts/discourse/components/private_message_map_component.js +++ b/app/assets/javascripts/discourse/components/private_message_map_component.js @@ -6,12 +6,18 @@ @namespace Discourse @module Discourse **/ -Discourse.PrivateMessageMapComponent = Ember.Component.extend({ +Discourse.PrivateMessageMapComponent = Ember.View.extend({ templateName: 'components/private-message-map', tagName: 'section', classNames: ['information'], details: Em.computed.alias('topic.details'), + init: function() { + this._super(); + this.set('context', this); + this.set('controller', this); + }, + actions: { removeAllowedUser: function(user) { var self = this; diff --git a/app/assets/javascripts/discourse/templates/components/private-message-map.js.handlebars b/app/assets/javascripts/discourse/templates/components/private-message-map.js.handlebars index f87538b125c..03d3dab1f22 100644 --- a/app/assets/javascripts/discourse/templates/components/private-message-map.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/private-message-map.js.handlebars @@ -1,11 +1,11 @@

{{i18n private_message_info.title}}

- {{#groupedEach view.details.allowed_groups}} + {{#groupedEach details.allowed_groups}}
#{{unbound name}}
{{/groupedEach}} - {{#groupedEach view.details.allowed_users}} + {{#groupedEach details.allowed_users}}
{{#link-to 'user' this}} {{avatar this imageSize="small"}} @@ -13,13 +13,13 @@ {{#link-to 'user' this}} {{unbound username}} {{/link-to}} - {{#if view.details.can_remove_allowed_users}} + {{#if details.can_remove_allowed_users}} {{/if}}
{{/groupedEach}}
-{{#if view.details.can_invite_to}} +{{#if details.can_invite_to}}