From 6b80c617124719fb314393c4d7ae4fe5da9264c7 Mon Sep 17 00:00:00 2001 From: Brock Whittaker Date: Mon, 28 Aug 2017 07:57:46 -0700 Subject: [PATCH] Allow for scrolling of stream membership table again. This adds perfectScrollbar to the `.subscriber_list_container` to allow for the table to scroll naturally again. This was broken because when perfectScrollbar is put on the parent element, any naturally scrolling element within it will not scroll naturally anymore. Tweaked by tabbott to update the scrollbar on rerender. Fixes: #6215. --- static/js/stream_edit.js | 3 +++ static/styles/subscriptions.css | 1 + 2 files changed, 4 insertions(+) diff --git a/static/js/stream_edit.js b/static/js/stream_edit.js index fa1cf16775..65e913af22 100644 --- a/static/js/stream_edit.js +++ b/static/js/stream_edit.js @@ -33,6 +33,7 @@ function rerender_subscribers_list(sub) { if (subscribers_list) { subscribers_list.data(emails); subscribers_list.render(); + ui.update_scrollbar($(".subscriber_list_container")); } } @@ -197,6 +198,8 @@ function show_subscription_settings(sub_row) { }, }).init(); + ui.set_up_scrollbar($(".subscriber_list_container")); + sub_settings.find('input[name="principal"]').typeahead({ source: people.get_realm_persons, // This is a function. items: 5, diff --git a/static/styles/subscriptions.css b/static/styles/subscriptions.css index cf9e65bf63..9ceec6ca9d 100644 --- a/static/styles/subscriptions.css +++ b/static/styles/subscriptions.css @@ -291,6 +291,7 @@ form#add_new_subscription { } .subscriber_list_container { + position: relative; max-height: 300px; overflow: auto; text-align: left;