mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
If you unnarrow while scrolling, wait for the scroll to finish.
Otherwise you may end up scrolled to a random place. (imported from commit 99d73b1876e3bde288b14b00bd48b1013f40e268)
This commit is contained in:
@@ -2,6 +2,12 @@ var ui = (function () {
|
||||
|
||||
var exports = {};
|
||||
|
||||
var actively_scrolling = false;
|
||||
|
||||
exports.actively_scrolling = function () {
|
||||
return actively_scrolling;
|
||||
};
|
||||
|
||||
// What, if anything, obscures the home tab?
|
||||
exports.home_tab_obscured = function () {
|
||||
if ($('.modal:visible').length > 0)
|
||||
@@ -659,6 +665,8 @@ $(function () {
|
||||
var scroll_start_message;
|
||||
|
||||
function scroll_finished() {
|
||||
actively_scrolling = false;
|
||||
|
||||
if ($('#home').hasClass('active')) {
|
||||
if (!suppress_scroll_pointer_update) {
|
||||
keep_pointer_in_view();
|
||||
@@ -683,6 +691,7 @@ $(function () {
|
||||
|
||||
var scroll_timer;
|
||||
function scroll_finish() {
|
||||
actively_scrolling = true;
|
||||
clearTimeout(scroll_timer);
|
||||
scroll_timer = setTimeout(scroll_finished, 100);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user