mirror of https://github.com/zulip/zulip.git
Remove message id list from group divs
(imported from commit 620a219b5e11db79bfea971fe40deb09173deb10)
This commit is contained in:
parent
305cf30c50
commit
f22885223f
|
@ -126,8 +126,6 @@ MessageListView.prototype = {
|
||||||
if (current_group.messages.length > 0) {
|
if (current_group.messages.length > 0) {
|
||||||
var first_message = current_group.messages[0];
|
var first_message = current_group.messages[0];
|
||||||
|
|
||||||
current_group.message_ids = _.pluck(current_group.messages, 'id');
|
|
||||||
|
|
||||||
current_group.is_stream = first_message.is_stream;
|
current_group.is_stream = first_message.is_stream;
|
||||||
current_group.is_private = first_message.is_private;
|
current_group.is_private = first_message.is_private;
|
||||||
|
|
||||||
|
@ -682,20 +680,6 @@ MessageListView.prototype = {
|
||||||
var row = this._rows[old_id];
|
var row = this._rows[old_id];
|
||||||
delete this._rows[old_id];
|
delete this._rows[old_id];
|
||||||
|
|
||||||
var prev_recipient_row = $(row).prev('.recipient_row');
|
|
||||||
if (prev_recipient_row.length > 0 &&
|
|
||||||
parseFloat(prev_recipient_row.attr('zid')) === old_id) {
|
|
||||||
prev_recipient_row.attr('zid', new_id);
|
|
||||||
|
|
||||||
var messages = prev_recipient_row.attr('data-messages').split();
|
|
||||||
var fixed_messages = _.map(messages, function (msgid) {
|
|
||||||
if (parseFloat(msgid) === old_id) {
|
|
||||||
return String(new_id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
prev_recipient_row.attr('data-messages', fixed_messages.join(" "));
|
|
||||||
|
|
||||||
}
|
|
||||||
row.setAttribute('zid', new_id);
|
row.setAttribute('zid', new_id);
|
||||||
row.setAttribute('id', this.table_name + new_id);
|
row.setAttribute('id', this.table_name + new_id);
|
||||||
$(row).removeClass('local');
|
$(row).removeClass('local');
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
{{partial "bookend"}}
|
{{partial "bookend"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="recipient_row" data-messages="{{message_ids}}">
|
<div class="recipient_row">
|
||||||
{{#if is_stream}}
|
{{#if is_stream}}
|
||||||
<div class="message_header message_header_stream right_part">
|
<div class="message_header message_header_stream right_part">
|
||||||
<div class="message-header-wrapper">
|
<div class="message-header-wrapper">
|
||||||
|
|
|
@ -297,8 +297,6 @@ function render(template_name, args) {
|
||||||
|
|
||||||
var html = render('message_group', {message_groups: groups});
|
var html = render('message_group', {message_groups: groups});
|
||||||
|
|
||||||
assert.equal($(html).next('.recipient_row').data('messages'), "1,2");
|
|
||||||
|
|
||||||
var first_message_text = $(html).next('.recipient_row').find('div.messagebox:first .message_content').text().trim();
|
var first_message_text = $(html).next('.recipient_row').find('div.messagebox:first .message_content').text().trim();
|
||||||
assert.equal(first_message_text, "This is message one.");
|
assert.equal(first_message_text, "This is message one.");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue