mirror of https://github.com/zulip/zulip.git
refactor: Change where we initialize scrolling code.
This is a more sensible place to initialize the the scrolling handler, plus it breaks an annoying indirect dependency on jQuery for the unit tests.
This commit is contained in:
parent
6c4b1183f2
commit
5a27ed6a72
|
@ -4,7 +4,7 @@ const {strict: assert} = require("assert");
|
||||||
|
|
||||||
const _ = require("lodash");
|
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");
|
const {run_test} = require("../zjsunit/test");
|
||||||
|
|
||||||
set_global("page_params", {
|
set_global("page_params", {
|
||||||
|
@ -13,9 +13,6 @@ set_global("page_params", {
|
||||||
is_guest: false,
|
is_guest: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
set_global("document", null);
|
|
||||||
stub_out_jquery();
|
|
||||||
|
|
||||||
zrequire("color_data");
|
zrequire("color_data");
|
||||||
zrequire("hash_util");
|
zrequire("hash_util");
|
||||||
zrequire("stream_topic_history");
|
zrequire("stream_topic_history");
|
||||||
|
|
|
@ -415,12 +415,4 @@ exports.all = new MessageList({
|
||||||
muting_enabled: false,
|
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;
|
window.message_list = exports;
|
||||||
|
|
|
@ -457,6 +457,14 @@ exports.initialize = function () {
|
||||||
$(document).on("compose_started compose_canceled compose_finished", () => {
|
$(document).on("compose_started compose_canceled compose_finished", () => {
|
||||||
bottom_of_feed.reset();
|
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;
|
window.message_viewport = exports;
|
||||||
|
|
Loading…
Reference in New Issue