Add sender actions to sender info popover

(imported from commit 803f7e6c51f40dc7131608b2ed295f6760925f8c)
This commit is contained in:
acrefoot 2013-07-17 11:26:18 -04:00
parent c7f031dc53
commit d8ad217bab
2 changed files with 34 additions and 2 deletions

View File

@ -199,6 +199,22 @@ exports.register_click_handlers = function () {
e.stopPropagation(); e.stopPropagation();
}); });
$('body').on('click', '.sender_info_popover .narrow_to_private_messages', function (e) {
var email = $(e.target).parents('ul').attr('data-email');
narrow.by('pm-with', email, {select_first_unread: true, trigger: 'user sidebar popover'});
popovers.hide_message_info_popover();
e.stopPropagation();
e.preventDefault();
});
$('body').on('click', '.sender_info_popover .narrow_to_messages_sent', function (e) {
var email = $(e.target).parents('ul').attr('data-email');
narrow.by('sender', email, {select_first_unread: true, trigger: 'user sidebar popover'});
popovers.hide_message_info_popover();
e.stopPropagation();
e.preventDefault();
});
$('#stream_filters').on('click', 'span.arrow', function (e) { $('#stream_filters').on('click', 'span.arrow', function (e) {
var elt = e.target; var elt = e.target;
if (stream_sidebar_popped() if (stream_sidebar_popped()
@ -274,7 +290,7 @@ exports.register_click_handlers = function () {
}); });
$('body').on('click', '.respond_personal_button', function (e) { $('body').on('click', '.respond_personal_button', function (e) {
respond_to_message({reply_type: 'personal', trigger: 'popover respond pm'}); respond_to_message({reply_type: 'personal', trigger: 'popover respond pm'});
popovers.hide_actions_popover(); popovers.hide_all();
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
}); });

View File

@ -1,5 +1,5 @@
{{! Contents of the "message info" popup }} {{! Contents of the "message info" popup }}
<ul class="nav nav-list actions_popover"> <ul class="nav nav-list actions_popover sender_info_popover" data-email="{{message.sender_email}}">
<div class="popover_info"> <div class="popover_info">
<li>Sent by <b>{{message.sender_full_name}}</b></li> <li>Sent by <b>{{message.sender_full_name}}</b></li>
<li class='my_email'>{{message.sender_email}}</li> <li class='my_email'>{{message.sender_email}}</li>
@ -11,4 +11,20 @@
<li class="small">(Message sent when you were not subscribed)</li> <li class="small">(Message sent when you were not subscribed)</li>
{{/if}} {{/if}}
</div> </div>
<hr />
<li>
<a href="#" class="respond_personal_button">
<i class="icon-vector-edit"></i> Send {{message.sender_full_name}}</b> a private message
</a>
</li>
<li>
<a href="#" class="narrow_to_private_messages">
<i class="icon-vector-user"></i> Narrow to private messages with {{message.sender_full_name}}
</a>
</li>
<li>
<a href="#" class="narrow_to_messages_sent">
<i class="icon-vector-bullhorn"></i> Narrow to messages sent by {{message.sender_full_name}}
</a>
</li>
</ul> </ul>