mirror of https://github.com/zulip/zulip.git
Add data-messages attribute to recipient rows.
This is to set up collapsing, but I think they could be useful in general, so I'm keeping this is a separate commit. (imported from commit 0da2b8ef246649f678c7cb6664ee78bf36aca076)
This commit is contained in:
parent
a0b28a03e4
commit
9662594bf4
|
@ -151,7 +151,9 @@ MessageListView.prototype = {
|
|||
|
||||
function finish_group() {
|
||||
if (current_group.length > 0) {
|
||||
new_message_groups.push(current_group);
|
||||
var message_ids = _.pluck(current_group, 'id');
|
||||
current_group[0].message_ids = message_ids;
|
||||
new_message_groups.push(message_ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,12 +213,12 @@ MessageListView.prototype = {
|
|||
|
||||
if (util.same_recipient(prev, message) && self.collapse_messages &&
|
||||
prev.historical === message.historical && !message.show_date) {
|
||||
current_group.push(message.id);
|
||||
current_group.push(message);
|
||||
// prev is no longer the last element in this block
|
||||
prev.include_footer = false;
|
||||
} else {
|
||||
finish_group();
|
||||
current_group = [message.id];
|
||||
current_group = [message];
|
||||
|
||||
// Add a space to the table, but not for the first element.
|
||||
message.include_recipient = true;
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
{{else}}
|
||||
|
||||
{{#include_recipient}}
|
||||
<tr zid="{{id}}" class="recipient_row" data-messages="{{message_ids}}">
|
||||
{{#if is_stream}}
|
||||
<tr zid="{{id}}" class="recipient_row">
|
||||
<td class="message_header_colorblock" style="background-color: {{background_color}};"></td>
|
||||
<td class="message_header message_header_stream right_part">
|
||||
{{#if invite_only}}<i class="icon-vector-lock" title="This is an invite-only stream"></i>{{/if}}
|
||||
|
@ -69,7 +69,6 @@
|
|||
</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr zid="{{id}}" class="recipient_row">
|
||||
<td class="message_header_colorblock message_header_private_message" style="background-color: {{background_color}};"></td>
|
||||
<td class="message_header message_header_private_message right_part dark_background">
|
||||
<span class="message_label_clickable narrows_by_recipient"
|
||||
|
|
Loading…
Reference in New Issue