Created
November 29, 2018 14:08
-
-
Save samvitm/7b0815262e724e3a42af74abaa35202e to your computer and use it in GitHub Desktop.
airim_chaport
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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