mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
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:
committed by
Steve Howell
parent
eda05d23bf
commit
246a5737e7
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user