diff --git a/static/js/ui.js b/static/js/ui.js index 377d861b9b..35b7e27027 100644 --- a/static/js/ui.js +++ b/static/js/ui.js @@ -4,8 +4,6 @@ var exports = {}; var actively_scrolling = false; -exports.have_scrolled_away_from_top = true; - exports.actively_scrolling = function () { return actively_scrolling; }; @@ -220,13 +218,10 @@ function scroll_finished() { pointer.suppress_scroll_pointer_update = false; } floating_recipient_bar.update(); - if (message_viewport.scrollTop() === 0 && - ui.have_scrolled_away_from_top) { - ui.have_scrolled_away_from_top = false; + if (message_viewport.scrollTop() === 0) { message_fetch.load_more_messages(current_msg_list); - } else if (!ui.have_scrolled_away_from_top) { - ui.have_scrolled_away_from_top = true; } + // When the window scrolls, it may cause some messages to // enter the screen and become read. Calling // unread_ops.process_visible will update necessary