Streamline recentering code.

When you make a call to set_message_position(), you already
know that the pointer is gonna be onscreen, so set the flag
to suppress scroll pointer updates.  This should be faster and
also avoid future confusing bugs where recenter_view() and
keep_pointer_in_view() run for the same event.

(Both callers to recenter_view pass in the selected message,
and then the calls to set_message_position() set the scrollTop
so that the selected message shows onscreen.)

(imported from commit f1a6f189b7899b280a6316ea7eb03f015d3d4ae3)
This commit is contained in:
Steve Howell 2013-05-31 17:45:40 -04:00
parent a63b0e31a7
commit 40ce4e0acc

View File

@ -39,6 +39,7 @@ exports.set_message_position = function (message_top, viewport_info, ratio) {
message_top
- message_offset;
suppress_scroll_pointer_update = true; // Gets set to false in the scroll handler.
jwindow.scrollTop(new_scroll_top);
};