Fixed idle mousemove

This commit is contained in:
Igor Zhukov 2015-02-12 23:01:20 +03:00
parent e916244391
commit 13b9d3efb0

View File

@ -823,6 +823,10 @@ angular.module('izhukov.utils', [])
function onEvent (e) { function onEvent (e) {
// console.log('event', e.type); // console.log('event', e.type);
if (e.type == 'mousemove') { if (e.type == 'mousemove') {
var e = e.originalEvent || e;
if (e && e.movementX === 0 && e.movementY === 0) {
return;
}
$($window).off('mousemove', onEvent); $($window).off('mousemove', onEvent);
} }
var isIDLE = e.type == 'blur' || e.type == 'timeout' ? true : false; var isIDLE = e.type == 'blur' || e.type == 'timeout' ? true : false;