mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 04:43:58 +00:00
refactor: Early-exit in message_scroll.scroll_finished.
This is just cosmetic to flatten the function a bit.
This commit is contained in:
@@ -28,13 +28,18 @@ exports.actively_scrolling = function () {
|
|||||||
exports.scroll_finished = function () {
|
exports.scroll_finished = function () {
|
||||||
actively_scrolling = false;
|
actively_scrolling = false;
|
||||||
|
|
||||||
if ($('#home').hasClass('active')) {
|
if (!$('#home').hasClass('active')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!pointer.suppress_scroll_pointer_update) {
|
if (!pointer.suppress_scroll_pointer_update) {
|
||||||
message_viewport.keep_pointer_in_view();
|
message_viewport.keep_pointer_in_view();
|
||||||
} else {
|
} else {
|
||||||
pointer.suppress_scroll_pointer_update = false;
|
pointer.suppress_scroll_pointer_update = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
floating_recipient_bar.update();
|
floating_recipient_bar.update();
|
||||||
|
|
||||||
if (message_viewport.scrollTop() === 0) {
|
if (message_viewport.scrollTop() === 0) {
|
||||||
message_fetch.load_more_messages({
|
message_fetch.load_more_messages({
|
||||||
msg_list: current_msg_list,
|
msg_list: current_msg_list,
|
||||||
@@ -48,7 +53,6 @@ exports.scroll_finished = function () {
|
|||||||
// unread_ops.process_visible will update necessary
|
// unread_ops.process_visible will update necessary
|
||||||
// data structures and DOM elements.
|
// data structures and DOM elements.
|
||||||
setTimeout(unread_ops.process_visible, 0);
|
setTimeout(unread_ops.process_visible, 0);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var scroll_timer;
|
var scroll_timer;
|
||||||
|
|||||||
Reference in New Issue
Block a user