Skip to content

Instantly share code, notes, and snippets.

@samvitm
Created November 29, 2018 14:08
Show Gist options
  • Save samvitm/7b0815262e724e3a42af74abaa35202e to your computer and use it in GitHub Desktop.
Save samvitm/7b0815262e724e3a42af74abaa35202e to your computer and use it in GitHub Desktop.
airim_chaport
<script type="text/javascript">
// hide the launcher on load so that only airim is visible
window.chaport.on('ready', function () {
window.chaport.hideLauncher();
})
// open chaport when live chat button is clicked
// hide the airim widget after opening
window.airim('on','liveChatClick',function(){
window.chaport.open();
window.airim('widgetHide');
})
// show the airim widget when the chaport widget is closed
window.chaport.on('widget.stateChange', function(state){
if(state.toState == 'collapsed'){
window.chaport.hideLauncher();
window.airim('widgetShow')
}
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment