From d1ef863f96b66ec29a56f0a04578b5c8974261a0 Mon Sep 17 00:00:00 2001 From: Brock Whittaker Date: Fri, 15 Sep 2017 14:01:36 -0700 Subject: [PATCH] Add perfectScrollbar to default streams table. This adds perfectScrollbar to the default streams table because it currently is inside another perfectScrollbar which actually makes it impossible to scroll the table normally without enabling the perfectScrollbar library on this. Fixes: #6391. --- static/js/list_render.js | 4 ++++ static/js/settings_streams.js | 5 +++++ static/styles/settings.css | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/static/js/list_render.js b/static/js/list_render.js index cc4478a7a4..5b314e1cc4 100644 --- a/static/js/list_render.js +++ b/static/js/list_render.js @@ -198,6 +198,10 @@ var list_render = (function () { // clear and re-initialize the list with the newly filtered subset // of items. prototype.clear().init(); + + if (opts.filter.onupdate) { + opts.filter.onupdate(); + } }); } diff --git a/static/js/settings_streams.js b/static/js/settings_streams.js index b4b5c9c4fe..8c1f5682d5 100644 --- a/static/js/settings_streams.js +++ b/static/js/settings_streams.js @@ -50,9 +50,14 @@ exports.build_default_stream_table = function (streams_data) { callback: function (item, value) { return item.name.toLowerCase().indexOf(value) >= 0; }, + onupdate: function () { + ui.update_scrollbar(table); + }, }, }).init(); + ui.set_up_scrollbar(table.closest(".progressive-table-wrapper")); + loading.destroy_indicator($('#admin_page_default_streams_loading_indicator')); self.remove = function (stream_id) { diff --git a/static/styles/settings.css b/static/styles/settings.css index a93be97344..4b4fc6fa13 100644 --- a/static/styles/settings.css +++ b/static/styles/settings.css @@ -599,10 +599,15 @@ input[type=checkbox].inline-block { } .progressive-table-wrapper { + position: relative; max-height: calc(95vh - 200px); overflow: auto; } +#admin-default-streams-list .progressive-table-wrapper { + max-height: calc(95vh - 270px); +} + .bots_list { display: none; list-style-type: none;