Refactor perfect-scrollbar: Call ui methods in stream_list.js.

This commit is contained in:
gooca 2018-03-15 16:02:29 +00:00 committed by Tim Abbott
parent 26eb60b382
commit 591624972e
2 changed files with 7 additions and 3 deletions

View File

@ -240,9 +240,13 @@ function initialize_stream_data() {
stream_list.scroll_element_into_container = noop;
var scrollbar_updated = false;
$.stub_selector("#stream-filters-container", {
perfectScrollbar: function () { scrollbar_updated = true; },
set_global('ui', {
update_scrollbar: function () {scrollbar_updated = true;},
});
ui.update_scrollbar(
$.stub_selector("#stream-filters-container")
);
assert(!$('<devel sidebar row html>').hasClass('active-filter'));

View File

@ -440,7 +440,7 @@ exports.handle_narrow_activated = function (filter) {
exports.scroll_stream_into_view(stream_li);
}
// Update scrollbar size.
$("#stream-filters-container").perfectScrollbar("update");
ui.update_scrollbar($("#stream-filters-container"));
};
exports.handle_narrow_deactivated = function () {