This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/private_message_map_component.js
Robin Ward a524194a46 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"
2014-01-21 13:08:47 -05:00

40 lines
1002 B
JavaScript

/**
The controls at the top of a private message in the map area.
@class PrivateMessageMapComponent
@extends Ember.Component
@namespace Discourse
@module Discourse
**/
Discourse.PrivateMessageMapComponent = 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;
bootbox.dialog(I18n.t("private_message_info.remove_allowed_user", {name: user.get('username')}), [
{label: I18n.t("no_value"),
'class': 'btn-danger rightg'},
{label: I18n.t("yes_value"),
'class': 'btn-primary',
callback: function() {
self.get('topic.details').removeAllowedUser(user);
}
}
]);
},
showPrivateInvite: function() {
this.sendAction('showPrivateInviteAction');
}
}
});