SHARE
TWEET

Untitled

a guest Sep 12th, 2015 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. this.createLiveSupport = function createLiveSupport() {
  2.         var button_contact              = $('li[role="livechat"] a.contact');
  3.         var button_chat                 = $('li[role="livechat"] a.chat');
  4.         var css_class                   = 'hide';
  5.                
  6.         Tawk_API.onStatusChange = function onStatusChange(status) {                    
  7.                 if([ 'online', 'away' ].indexOf(status) != -1) {
  8.                         button_contact.addClass(css_class);
  9.                         button_chat.removeClass(css_class);
  10.                 } else {
  11.                         button_contact.removeClass(css_class);
  12.                         button_chat.addClass(css_class);
  13.                 }
  14.         };
  15.                
  16.         Tawk_API.onMessage = function onMessage(data) {
  17.                 console.log('New message from us');
  18.                 Tawk_API.maximize();
  19.         };
  20. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top