Created
June 16, 2014 14:51
-
-
Save DeskWOW/033d082b0cc5cf90cf8f to your computer and use it in GitHub Desktop.
Reveal chat link only if one or more agent is online and ready to chat. We determine how many agents are available to chat by counting how many agents have routing enabled.
This file contains hidden or 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
$(function() { | |
$.ajax({ | |
url: 'http://your-site.desk.com/customer/agent_online_check', | |
dataType: 'jsonp' | |
}).done(function(data) { | |
if (data.routing_agents > 0) { | |
$(".chat-link").show(); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What do you mean : “.chat-link” ?