Fix javascript bug in maybe_autoscroll.

I'd check for bookends, but not daterows. Now, we just check if we can get
a message id out of it, rather than excluding specific types of rows.

(imported from commit 39ebc35e81dcec7fc83b603bf941f816fcd3d38d)
This commit is contained in:
acrefoot
2013-12-13 15:46:16 -05:00
parent 685830b66a
commit 29907f3c71

View File

@@ -458,8 +458,12 @@ MessageListView.prototype = {
// starting from the last message, ignore message heights that weren't sent by me.
if(id_of_last_message_sent_by_us > -1) {
distance_to_last_message_sent_by_me += elem.offsetHeight;
} else if (elem.className !== "bookend_tr" &&
this.get_message(rows.id($(elem))).sender_email === page_params.email)
return;
}
var row_id = rows.id($(elem));
// check for `row_id` NaN in case we're looking at a date row or bookend row
if (row_id > -1 &&
this.get_message(row_id).sender_email === page_params.email)
{
distance_to_last_message_sent_by_me += elem.offsetHeight;
id_of_last_message_sent_by_us = rows.id($(elem));