diff --git a/static/js/message_scroll.js b/static/js/message_scroll.js index 79cc46c7ce..7bc11abaec 100644 --- a/static/js/message_scroll.js +++ b/static/js/message_scroll.js @@ -39,7 +39,7 @@ exports.scroll_finished = function () { if (!pointer.suppress_scroll_pointer_update) { message_viewport.keep_pointer_in_view(); } else { - pointer.suppress_scroll_pointer_update = false; + pointer.set_suppress_scroll_pointer_update(false); } floating_recipient_bar.update(); diff --git a/static/js/message_viewport.js b/static/js/message_viewport.js index dba3545008..f154d51fa2 100644 --- a/static/js/message_viewport.js +++ b/static/js/message_viewport.js @@ -125,7 +125,7 @@ exports.set_message_position = function (message_top, message_height, viewport_i message_top - message_offset; - pointer.suppress_scroll_pointer_update = true; // Gets set to false in the scroll handler. + pointer.set_suppress_scroll_pointer_update(true); // Gets set to false in the scroll handler. exports.scrollTop(new_scroll_top); }; @@ -282,7 +282,7 @@ exports.is_narrow = function () { }; exports.system_initiated_animate_scroll = function (scroll_amount) { - pointer.suppress_scroll_pointer_update = true; // Gets set to false in the scroll handler. + pointer.set_suppress_scroll_pointer_update(true); // Gets set to false in the scroll handler. var viewport_offset = exports.scrollTop(); in_stoppable_autoscroll = true; exports.message_pane.animate({ @@ -294,7 +294,7 @@ exports.system_initiated_animate_scroll = function (scroll_amount) { }; exports.user_initiated_animate_scroll = function (scroll_amount) { - pointer.suppress_scroll_pointer_update = true; // Gets set to false in the scroll handler. + pointer.set_suppress_scroll_pointer_update(true); // Gets set to false in the scroll handler. in_stoppable_autoscroll = false; // defensive var viewport_offset = exports.scrollTop(); diff --git a/static/js/pointer.js b/static/js/pointer.js index a72aa90bc9..688a80674f 100644 --- a/static/js/pointer.js +++ b/static/js/pointer.js @@ -13,6 +13,9 @@ exports.set_recenter_pointer_on_display = function (value) { // Toggles re-centering the pointer in the window // when All Messages is next clicked by the user exports.suppress_scroll_pointer_update = false; +exports.set_suppress_scroll_pointer_update = function (value) { + exports.suppress_scroll_pointer_update = value; +}; exports.furthest_read = -1; exports.set_furthest_read = function (value) { exports.furthest_read = value; diff --git a/static/js/stream_muting.js b/static/js/stream_muting.js index 2d33f414c6..5fe09677b9 100644 --- a/static/js/stream_muting.js +++ b/static/js/stream_muting.js @@ -39,7 +39,7 @@ exports.update_is_muted = function (sub, value) { // make sure the pointer is still visible. We don't want the auto-scroll handler to move // our pointer to the old scroll location before we have a chance to update it. pointer.set_recenter_pointer_on_display(true); - pointer.suppress_scroll_pointer_update = true; + pointer.set_suppress_scroll_pointer_update(true); if (!home_msg_list.empty()) { message_util.do_unread_count_updates(home_msg_list.all_messages());