dead code: Remove useless resize calls.

We had a bunch of places where we
were calling `resize.resize_bottom_whitespace`
with no arguments, which has been a no-op
since the below commit that removed support
for our `autoscroll_forever` option:

    fa44d2ea69

With the `autoscroll_forever` options things
like opening/closing the compose box could
alter how much bottom whitespace you'd want,
but we stopped supporting that feature in
2017.

Since then bottom_whitespace has just always
been 40% of the viewport size.  So we only need
to change it on actual resize events.

It's worth noting that we still call
`resize_bottom_whitespace` indirectly in many
places, via `resize_page_components`, and
the latter actually causes
`resize_bottom_whitespace` to do real work,
but that work is redundant for most of those
codepaths, since they're not triggered by
changes to the viewport.  So there are other
opportunities for cleanup.
This commit is contained in:
Steve Howell
2020-05-27 19:08:13 +00:00
committed by Tim Abbott
parent ac3de453fb
commit 9489960b73
9 changed files with 2 additions and 21 deletions

View File

@@ -22,9 +22,6 @@ const _document = {
const _drafts = {
delete_draft_after_send: noop,
};
const _resize = {
resize_bottom_whitespace: noop,
};
const _sent_messages = {
start_tracking_message: noop,
@@ -42,7 +39,6 @@ set_global('drafts', _drafts);
set_global('navigator', _navigator);
set_global('notifications', _notifications);
set_global('reminder', _reminder);
set_global('resize', _resize);
set_global('sent_messages', _sent_messages);
set_global('local_message', {});
@@ -52,6 +48,7 @@ set_global('stream_edit', {});
set_global('markdown', {});
set_global('loading', {});
set_global('page_params', {});
set_global('resize', {});
set_global('subs', {});
set_global('ui_util', {});

View File

@@ -63,10 +63,6 @@ set_global('drafts', {
update_draft: noop,
});
set_global('resize', {
resize_bottom_whitespace: noop,
});
set_global('narrow_state', {
set_compose_defaults: noop,
});

View File

@@ -35,7 +35,6 @@ set_global('notifications', {
hide_or_show_history_limit_message: () => {},
});
set_global('pm_list', {});
set_global('resize', {});
set_global('server_events', {});
set_global('stream_list', {
maybe_scroll_narrow_into_view: () => {},
@@ -48,7 +47,6 @@ const alice = {
};
people.add_active_user(alice);
resize.resize_bottom_whitespace = noop;
server_events.home_view_loaded = noop;
function stub_message_view(list) {