Permalink
Browse files

Merge pull request #2 from adisrika/master

Adding support for firefox in idleTimer gallery module
  • Loading branch information...
2 parents c512538 + 3bf759d commit 2795010a659f2d0be53cfda0f48b0178e81927c3 @nzakas committed Jul 18, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/gallery-idletimer/js/idletimer.js
@@ -36,7 +36,7 @@ function handleUserEvent(event){
if (enabled){
if (/visibilitychange/.test(event.type)){
- toggleIdleState(doc.hidden || doc.msHidden || doc.webkitHidden);
+ toggleIdleState(doc.hidden || doc.msHidden || doc.webkitHidden || doc.mozHidden);
} else {
//if it's idle, that means the user is no longer idle
if (idle){
@@ -133,6 +133,7 @@ Y.IdleTimer = {
//need to add the old-fashioned way
doc.addEventListener("msvisibilitychange", handleUserEvent, false)
doc.addEventListener("webkitvisibilitychange", handleUserEvent, false)
+ doc.addEventListener("mozvisibilitychange", handleUserEvent, false)
//set a timeout to toggle state
tId = setTimeout(toggleIdleState, timeout);
@@ -159,10 +160,11 @@ Y.IdleTimer = {
doc.removeEventListener("msvisibilitychange", handleUserEvent, false)
doc.removeEventListener("webkitvisibilitychange", handleUserEvent, false)
+ doc.removeEventListener("mozvisibilitychange", handleUserEvent, false)
}
};
//inherit event functionality
-Y.augment(Y.IdleTimer, Y.Event.Target);
+Y.augment(Y.IdleTimer, Y.Event.Target);

0 comments on commit 2795010

Please sign in to comment.