mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
narrow: Simplify actively_scrolling data flow.
There's no good reason to have the caller of deactivate pass this
parameter in.
This effectively reverts a18b1662cb,
which did this as part of trying to avoid an import cycle, with a more
appropriate solution using the existing message_scroll_state module.
Importantly, it also means that we again wait for scrolls longer than
50ms to finish before opening All messages; I think this might fix a
regression.
This commit is contained in:
@@ -11,8 +11,6 @@ import * as unread from "./unread";
|
||||
import * as unread_ops from "./unread_ops";
|
||||
import * as unread_ui from "./unread_ui";
|
||||
|
||||
let actively_scrolling = false;
|
||||
|
||||
let hide_scroll_to_bottom_timer;
|
||||
export function hide_scroll_to_bottom() {
|
||||
const $show_scroll_to_bottom_button = $("#scroll-to-bottom-button-container");
|
||||
@@ -57,12 +55,8 @@ $(document).on("keydown", (e) => {
|
||||
$("#scroll-to-bottom-button-container").removeClass("show");
|
||||
});
|
||||
|
||||
export function is_actively_scrolling() {
|
||||
return actively_scrolling;
|
||||
}
|
||||
|
||||
export function scroll_finished() {
|
||||
actively_scrolling = false;
|
||||
message_scroll_state.set_actively_scrolling(false);
|
||||
message_lists.current.view.update_sticky_recipient_headers();
|
||||
hide_scroll_to_bottom();
|
||||
|
||||
@@ -106,7 +100,7 @@ export function scroll_finished() {
|
||||
|
||||
let scroll_timer;
|
||||
function scroll_finish() {
|
||||
actively_scrolling = true;
|
||||
message_scroll_state.set_actively_scrolling(true);
|
||||
|
||||
// Don't present the "scroll to bottom" widget if the current
|
||||
// scroll was triggered by the keyboard.
|
||||
|
||||
Reference in New Issue
Block a user