ui.get_scroll_element: Set up SimpleBar if it’s expected but missing.

Although SimpleBar automatically sets itself up on elements with a
`data-simplebar` attribute, sometimes we try to set event listeners
before that happens.  Create the SimpleBar early in that case.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2019-07-25 15:22:43 -07:00
parent 48526b1fd6
commit f0e0fe1c15
3 changed files with 9 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ function init_simulated_scrolling() {
});
var elem = {
dataset: {},
scrollTop: 0,
scrollHeight: 0,
};

View File

@@ -340,6 +340,9 @@ run_test('zoom_in_and_zoom_out', () => {
f.call(elem(stream_li1));
f.call(elem(stream_li2));
};
$('#stream-filters-container')[0] = {
dataset: {},
};
stream_list.set_event_handlers();
stream_list.zoom_in_topics({stream_id: 42});