Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

refactor: Change where we initialize scrolling code.

Steve Howell5a27ed6a720d
diff --git a/frontend_tests/node_tests/stream_data.js b/frontend_tests/node_tests/stream_data.js
index 1f9372699c2..b2d45a45467 100644
--- a/frontend_tests/node_tests/stream_data.js
+++ b/frontend_tests/node_tests/stream_data.js
@@ -4,7 +4,7 @@ const {strict: assert} = require("assert");
const _ = require("lodash");
-const {set_global, stub_out_jquery, zrequire} = require("../zjsunit/namespace");
+const {set_global, zrequire} = require("../zjsunit/namespace");
const {run_test} = require("../zjsunit/test");
set_global("page_params", {
@@ -13,9 +13,6 @@ set_global("page_params", {
is_guest: false,
});
-set_global("document", null);
-stub_out_jquery();
-
zrequire("color_data");
zrequire("hash_util");
zrequire("stream_topic_history");
diff --git a/static/js/message_list.js b/static/js/message_list.js
index b3b7d42afb1..e4bcee26333 100644
--- a/static/js/message_list.js
+++ b/static/js/message_list.js
@@ -415,12 +415,4 @@ exports.all = new MessageList({
muting_enabled: false,
});
-// We stop autoscrolling when the user is clearly in the middle of
-// doing something. Be careful, though, if you try to capture
-// mousemove, then you will have to contend with the autoscroll
-// itself generating mousemove events.
-$(document).on("message_selected.zulip wheel", () => {
- message_viewport.stop_auto_scrolling();
-});
-
window.message_list = exports;
diff --git a/static/js/message_viewport.js b/static/js/message_viewport.js
index a735ec8bab1..ad674a903d9 100644
--- a/static/js/message_viewport.js
+++ b/static/js/message_viewport.js
@@ -457,6 +457,14 @@ exports.initialize = function () {
$(document).on("compose_started compose_canceled compose_finished", () => {
bottom_of_feed.reset();
});
+
+ // We stop autoscrolling when the user is clearly in the middle of
+ // doing something. Be careful, though, if you try to capture
+ // mousemove, then you will have to contend with the autoscroll
+ // itself generating mousemove events.
+ $(document).on("message_selected.zulip wheel", () => {
+ exports.stop_auto_scrolling();
+ });
};
window.message_viewport = exports;