Skip to content

Instantly share code, notes, and snippets.

@DeskWOW
Created June 16, 2014 14:51
Show Gist options
  • Save DeskWOW/033d082b0cc5cf90cf8f to your computer and use it in GitHub Desktop.
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.
$(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();
}
});
});
@denistaran
Copy link

What do you mean : “.chat-link” ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment