nl_tokens: Event handlers {{{ 1
pl_tokens: function visibilityChange ( ev ) { // {{{2 var that = this ; if ( this . visibilityTimeout ) { clearTimeout ( this . visibilityTimeout ) ; this . visibilityTimeout = undefined ; } <mask> ( document . visibilityState ) { case 'hidden' : //    console.log('DOCUMENT HIDE'); // Wait 10 seconds before peer disconnect. this . visibilityTimeout = setTimeout ( function ( ) { that . visibilityTimeout = undefined ; O . gw . disconnect ( ) ; } , 10 * 1000 ) ; return ; case 'visible' : //    console.log('DOCUMENT SHOW'); if ( ! O . gw . isConnected ( ) ) { O . gw . connect ( ) ; } return ; } }