fix: add pauseScrollEvents method to ScrollManagerV2
This commit is contained in:
parent
8fa7cb2eae
commit
3e97ca2ac9
@ -359,6 +359,28 @@ export class ScrollManagerV2 {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Приостанавливает обработку scroll событий на указанное время
|
||||
* @param {number} duration - Длительность паузы в миллисекундах
|
||||
*/
|
||||
pauseScrollEvents(duration = 1000) {
|
||||
console.log('[ScrollManagerV2] ⏸️ Pausing scroll events for', duration, 'ms');
|
||||
|
||||
// Сохраняем оригинальный debounced handler
|
||||
const originalHandler = this._debouncedLoadHistory;
|
||||
|
||||
// Заменяем на no-op функцию
|
||||
this._debouncedLoadHistory = () => {
|
||||
console.log('[ScrollManagerV2] 🚫 Scroll events paused, ignoring history load');
|
||||
};
|
||||
|
||||
// Восстанавливаем оригинальный handler через указанное время
|
||||
setTimeout(() => {
|
||||
this._debouncedLoadHistory = originalHandler;
|
||||
console.log('[ScrollManagerV2] ▶️ Scroll events resumed');
|
||||
}, duration);
|
||||
}
|
||||
|
||||
/**
|
||||
* Проверяет, находится ли пользователь внизу
|
||||
* @param {number} [threshold] - Порог в пикселях
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user