From 407b13af25fc088f77295b64d0ca810f6992eefc Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 26 Jul 2018 20:13:37 +0000 Subject: [PATCH] list_cursor: Replace container with scroll_container_sel. Our lists tend to have both containers and scroll_containers, and we care more about the latter to the extent they're different. --- static/js/list_cursor.js | 5 +++-- static/js/stream_list.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/static/js/list_cursor.js b/static/js/list_cursor.js index 3eacb56638..ef10a02d79 100644 --- a/static/js/list_cursor.js +++ b/static/js/list_cursor.js @@ -4,7 +4,7 @@ var list_cursor = function (opts) { var config_ok = opts.highlight_class && opts.list && - opts.list.container && + opts.list.scroll_container_sel && opts.list.find_li && opts.list.first_key && opts.list.prev_key && @@ -61,7 +61,8 @@ var list_cursor = function (opts) { }; self.adjust_scroll = function (li) { - scroll_util.scroll_element_into_container(li, opts.list.container); + var scroll_container = $(opts.list.scroll_container_sel); + scroll_util.scroll_element_into_container(li, scroll_container); }; self.redraw = function () { diff --git a/static/js/stream_list.js b/static/js/stream_list.js index d459321753..b9d5bc0140 100644 --- a/static/js/stream_list.js +++ b/static/js/stream_list.js @@ -534,7 +534,7 @@ exports.initialize = function () { exports.stream_cursor = list_cursor({ list: { - container: $('#stream-filters-container'), + scroll_container_sel: '#stream-filters-container', find_li: function (opts) { var stream_id = opts.key; var li = exports.get_stream_li(stream_id);