mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 02:17:19 +00:00
Avoid unnecessary rows.get in pointer management
(imported from commit ef1d8a885b264be797616a2bab3f23e2702949c5)
This commit is contained in:
@@ -752,7 +752,7 @@ function at_bottom_of_viewport() {
|
|||||||
|
|
||||||
function keep_pointer_in_view() {
|
function keep_pointer_in_view() {
|
||||||
var candidate;
|
var candidate;
|
||||||
var next_message = rows.get(selected_message_id);
|
var next_message = selected_message;
|
||||||
if (next_message.length === 0)
|
if (next_message.length === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -781,7 +781,7 @@ function keep_pointer_in_view() {
|
|||||||
// I'm at the very top or the very bottom of the page.
|
// I'm at the very top or the very bottom of the page.
|
||||||
function move_pointer_at_page_top_and_bottom(delta) {
|
function move_pointer_at_page_top_and_bottom(delta) {
|
||||||
if (delta !== 0 && (at_top_of_viewport() || at_bottom_of_viewport())) {
|
if (delta !== 0 && (at_top_of_viewport() || at_bottom_of_viewport())) {
|
||||||
var next_message = rows.get(selected_message_id);
|
var next_message = selected_message;
|
||||||
if (delta > 0) {
|
if (delta > 0) {
|
||||||
// Scrolling up (want older messages)
|
// Scrolling up (want older messages)
|
||||||
next_message = rows.prev_visible(next_message);
|
next_message = rows.prev_visible(next_message);
|
||||||
|
|||||||
Reference in New Issue
Block a user