|
@ -143,28 +143,26 @@ vAPI.messaging = { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
return this.channels[channelName]; |
|
|
return this.channels[channelName]; |
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
var toggleListener = function({type, persisted}) { |
|
|
|
|
|
if ( !vAPI.messaging.connector ) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
toggleListener: function({type, persisted}) { |
|
|
|
|
|
if ( !vAPI.messaging.connector ) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if ( type === 'pagehide' ) { |
|
|
|
|
|
removeMessageListener(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if ( type === 'pagehide' ) { |
|
|
|
|
|
removeMessageListener(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if ( persisted ) { |
|
|
|
|
|
addMessageListener(vAPI.messaging.connector); |
|
|
|
|
|
|
|
|
if ( persisted ) { |
|
|
|
|
|
addMessageListener(vAPI.messaging.connector); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
window.addEventListener('pagehide', toggleListener, true); |
|
|
|
|
|
window.addEventListener('pageshow', toggleListener, true); |
|
|
|
|
|
|
|
|
window.addEventListener('pagehide', vAPI.messaging.toggleListener, true); |
|
|
|
|
|
window.addEventListener('pageshow', vAPI.messaging.toggleListener, true); |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|