Use a message's position not offset() to detect if it's off the bottom of the page

(imported from commit f7915c567b54ad5fd82daf137f89db566a1b417b)
This commit is contained in:
Leo Franchi
2014-03-07 13:41:25 -05:00
committed by Steve Howell
parent eda05d23bf
commit 246a5737e7

View File

@@ -31,11 +31,7 @@ function hide() {
// If there's a custom message, or if the last message is off the bottom of the
// screen, then show the notifications bar.
exports.update = function (num_unread) {
var last_row = rows.last_visible();
if (last_row
&& last_row.offset() !== null // otherwise the next line will error
&& viewport.is_below_visible_bottom(last_row.offset().top + last_row.height())
&& num_unread > 0) {
if (!viewport.bottom_message_visible() && num_unread > 0) {
show();
} else {
hide();