From 62e272ce276dd437ac1506c4b993b59dc9dad8fb Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 16 Feb 2021 15:00:01 +0000 Subject: [PATCH] stream settings: Remove obsolete scrolling code. We just want to reset the scrollbar here, which we still do via ui.reset_scrollbar. You don't want to preserve scroll position if you are filtering or re-sorting. --- frontend_tests/node_tests/subs.js | 13 ------------- static/js/subs.js | 4 ---- 2 files changed, 17 deletions(-) diff --git a/frontend_tests/node_tests/subs.js b/frontend_tests/node_tests/subs.js index 79aeb06af3..98290f9523 100644 --- a/frontend_tests/node_tests/subs.js +++ b/frontend_tests/node_tests/subs.js @@ -28,18 +28,6 @@ set_global("hash_util", { }); run_test("filter_table", () => { - const stream_list = $(".streams-list"); - - let scrolltop_called = false; - stream_list.scrollTop = function (set) { - scrolltop_called = true; - if (!set) { - return 10; - } - assert.equal(set, 10); - return this; - }; - // set-up sub rows stubs const sub_row_data = [ { @@ -167,7 +155,6 @@ run_test("filter_table", () => { // assert these once and call it done assert(ui_called); - assert(scrolltop_called); assert(tooltip_called); assert.deepEqual(sub_table_append, [ ".stream-row-poland", diff --git a/static/js/subs.js b/static/js/subs.js index 9b2ba32709..0c76b53524 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -433,7 +433,6 @@ exports.filter_table = function (left_panel_params) { } const widgets = new Map(); - const streams_list_scrolltop = ui.get_scroll_element($(".streams-list")).scrollTop(); const stream_ids = []; @@ -478,9 +477,6 @@ exports.filter_table = function (left_panel_params) { } exports.maybe_reset_right_panel(); - - // this puts the scrollTop back to what it was before the list was updated again. - ui.get_scroll_element($(".streams-list")).scrollTop(streams_list_scrolltop); }; let sort_order = "by-stream-name";