mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +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
|
// If there's a custom message, or if the last message is off the bottom of the
|
||||||
// screen, then show the notifications bar.
|
// screen, then show the notifications bar.
|
||||||
exports.update = function (num_unread) {
|
exports.update = function (num_unread) {
|
||||||
var last_row = rows.last_visible();
|
if (!viewport.bottom_message_visible() && num_unread > 0) {
|
||||||
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) {
|
|
||||||
show();
|
show();
|
||||||
} else {
|
} else {
|
||||||
hide();
|
hide();
|
||||||
|
|||||||
Reference in New Issue
Block a user