diff --git a/doc/index.html b/doc/index.html index 57204dfc81beb5bfebd5039db1cd7a7e718617a2..8845ce6e102418047905eab518cc3cd45d64ec44 100644 --- a/doc/index.html +++ b/doc/index.html @@ -13,7 +13,7 @@ <ul> <li>Systems <ul> - <li><a href="#systems/app-mode">app-mode</a></li><li><a href="#systems/personal-space-bubble">personal-space-bubble</a></li> + <li><a href="#systems/app-mode">app-mode</a></li><li><a href="#systems/exit-on-blur">exit-on-blur</a></li><li><a href="#systems/personal-space-bubble">personal-space-bubble</a></li> </ul> </li> @@ -267,6 +267,10 @@ <a name="systems/app-mode"></a><h4>app-mode</h4> <p>Simple system for keeping track of a modal app state</p> <span>src/systems/app-mode.js</span> + </article><article> + <a name="systems/exit-on-blur"></a><h4>exit-on-blur</h4> + <p>Emits an "exit" event when a user has stopped using the app for a certain period of time</p> + <span>src/systems/exit-on-blur.js</span> </article><article> <a name="systems/personal-space-bubble"></a><h4>personal-space-bubble</h4> <p>Iterates through bubbles and invaders on every tick and sets invader state accordingly. testing multiline things</p> diff --git a/src/systems/exit-on-blur.js b/src/systems/exit-on-blur.js index c6820a4016cbd3440bab91997e19741b006b6b29..5fe0b6fd6f7f87ae431e6844935cd4bcb44595e2 100644 --- a/src/systems/exit-on-blur.js +++ b/src/systems/exit-on-blur.js @@ -1,3 +1,7 @@ +/** + * Emits an "exit" event when a user has stopped using the app for a certain period of time + * @system exit-on-blur + */ AFRAME.registerSystem("exit-on-blur", { init() { this.onBlur = this.onBlur.bind(this);