I've bound mousemove of my app to check if the user is still using it:
<body data-ng-mousemove="data.OnMouseMove()"
where my controller does this:
$scope.data.OnMouseMove = function ()
{
AccountService.RefreshToken();
};
This works fine but breaks animations if the user continuously moves the mouse. So I want to disable the mousemove event for 20 seconds but don't know how to. Something like this pseudocode:
$scope.data.OnMouseMove = function ()
{
document.getElementsByTagName("body")[0].data-ng-mousemove = "";
AccountService.RefreshToken();
window.setTimeout(function ()
{
document.getElementsByTagName("body")[0].data-ng-mousemove = "data.OnMouseMove()";
}, 20000);
};