3

ng-idle is not working in IE9 and IE10. Suppose if you leave the mouse pointer on the page, it is not considering as the user is inactive. When you keep the mouse pointer is outside of the page it is working.

Please provide solution for this.

Use following url to check http://hackedbychinese.github.io/ng-idle/

4

2 回答 2

2

Replace

$document.find('body').on(options.interrupt, function(event) {
    svc.interrupt();
}

with the following code in angular-idle.js

$document.find('body').on(options.interrupt, function(event) {
    if (event.type !== 'mousemove' || (event.movementX || event.movementY)) {
        svc.interrupt();
    }
});
于 2015-06-15T06:12:44.710 回答
1

It seems the issue is with the mousemove event, the quick fix for it can be the removal of mousemove event for the IE browser. Write a conditional statement using useragent and use interrupt() method of ng-idle to configure events.

if (navigator.userAgent.toLowerCase().indexOf("msie") > 0) {
            // Code for Internet Explorer because ng-idle doesn't stop listening mousemove event.
            IdleProvider.interrupt('keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll'); 
        }
        else {
            IdleProvider.interrupt('mousemove keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll'); 
        } 
于 2015-06-11T13:25:55.130 回答