Fix hitting down-arrow at bottom of message list.

Previously the viewport.scrollTop() command that we ran in this case
would actually scroll far off the bottom of the site; it only did
something that looked reasonable because bottom_whitespace was small
and thus the scroll was truncated.

This version scrolls to 10% of the viewport away from the top.  We may
need to tweak that to instead be a fixed number of pixels or something.

(imported from commit 0176bf6e3662dfa24887f41b110b429bd8054cb0)
This commit is contained in:
Tim Abbott 2013-07-08 14:54:27 -04:00
parent 0e8c55395c
commit 54c32992fd
1 changed files with 2 additions and 1 deletions

View File

@ -199,7 +199,8 @@ function process_hotkey(e) {
//
// FIXME: this doesn't work for End because rows.last_visible()
// always returns a message.
viewport.scrollTop($("#main_div").outerHeight(true));
var current_msg_table = rows.get_table(current_msg_list.table_name);
viewport.scrollTop(current_msg_table.outerHeight(true) - viewport.height() * 0.1);
mark_current_list_as_read();
}
return true;