use passive event listener for mousewheel
parent
e5dd2e0b46
commit
c2f2fb3816
|
@ -37,7 +37,8 @@ class UserActivity {
|
||||||
// itself being scrolled. Need to use addEventListener's useCapture.
|
// itself being scrolled. Need to use addEventListener's useCapture.
|
||||||
// also this needs to be the wheel event, not scroll, as scroll is
|
// also this needs to be the wheel event, not scroll, as scroll is
|
||||||
// fired when the view scrolls down for a new message.
|
// fired when the view scrolls down for a new message.
|
||||||
window.addEventListener('wheel', this._onUserActivity.bind(this), true);
|
window.addEventListener('wheel', this._onUserActivity.bind(this),
|
||||||
|
{ passive: true, capture: true });
|
||||||
this.lastActivityAtTs = new Date().getTime();
|
this.lastActivityAtTs = new Date().getTime();
|
||||||
this.lastDispatchAtTs = 0;
|
this.lastDispatchAtTs = 0;
|
||||||
this.activityEndTimer = undefined;
|
this.activityEndTimer = undefined;
|
||||||
|
@ -50,7 +51,8 @@ class UserActivity {
|
||||||
document.onmousedown = undefined;
|
document.onmousedown = undefined;
|
||||||
document.onmousemove = undefined;
|
document.onmousemove = undefined;
|
||||||
document.onkeypress = undefined;
|
document.onkeypress = undefined;
|
||||||
window.removeEventListener('wheel', this._onUserActivity.bind(this), true);
|
window.removeEventListener('wheel', this._onUserActivity.bind(this),
|
||||||
|
{ passive: true, capture: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue