discourse/app/assets/javascripts/discourse/controllers/user_private_messages_controller.js
2013-02-26 15:20:06 -05:00

25 lines
734 B
JavaScript

/**
This controller handles actions related to a user's private messages.
@class UserPrivateMessagesController
@extends Discourse.ObjectController
@namespace Discourse
@module Discourse
**/
Discourse.UserPrivateMessagesController = Discourse.ObjectController.extend({
editPreferences: function() {
return Discourse.URL.routeTo("/users/" + (this.get('content.username_lower')) + "/preferences");
},
composePrivateMessage: function() {
var composerController;
composerController = Discourse.get('router.composerController');
return composerController.open({
action: Discourse.Composer.PRIVATE_MESSAGE,
archetypeId: 'private_message',
draftKey: 'new_private_message'
});
}
});