Merge pull request #157 from matrix-org/rav/clicks_are_activity_too

Consider mouse-clicking as user activity
This commit is contained in:
Richard van der Hoff 2016-02-12 10:41:27 +00:00
commit 3785cb3f15

View file

@ -30,6 +30,7 @@ class UserActivity {
* Start listening to user activity
*/
start() {
document.onmousedown = this._onUserActivity.bind(this);
document.onmousemove = this._onUserActivity.bind(this);
document.onkeypress = this._onUserActivity.bind(this);
// can't use document.scroll here because that's only the document
@ -46,6 +47,7 @@ class UserActivity {
* Stop tracking user activity
*/
stop() {
document.onmousedown = undefined;
document.onmousemove = undefined;
document.onkeypress = undefined;
window.removeEventListener('wheel', this._onUserActivity.bind(this), true);