SAAS-948 - Add livechat event listeners

This commit is contained in:
Duncan Sommerville 2015-08-14 10:24:49 -04:00
parent 32100e2d9b
commit 809b743785
3 changed files with 22 additions and 11 deletions

View file

@ -23,10 +23,10 @@ div.ColVis_collectionBackground {
overflow: auto; overflow: auto;
-webkit-transition: top 0.2s linear; -webkit-transition: top 0.2s linear, padding 0.2s linear;
-moz-transition: top 0.2s linear; -moz-transition: top 0.2s linear, padding 0.2s linear;
-o-transition: top 0.2s linear; -o-transition: top 0.2s linear, padding 0.2s linear;
transition: top 0.2s linear; transition: top 0.2s linear, padding 0.2s linear;
} }
/* Usability hint */ /* Usability hint */

View file

@ -11,13 +11,9 @@ $(document).ready(function() {
// savePanelSpace: true // savePanelSpace: true
//}); //});
if($('#livechat-compact-container:not(:visible)')) {
$('.wrapper').css('padding-bottom', 10);
}
//this statement tells the browser to fade out any success message after 5 seconds //this statement tells the browser to fade out any success message after 5 seconds
setTimeout(function(){$(".success").fadeOut("slow", function(){$(this).empty()});}, 5000); setTimeout(function(){$(".success").fadeOut("slow", function(){$(this).empty()});}, 5000);
if ($('.usability_hint:visible')) { if ($('.usability_hint').is(':visible')) {
$(".wrapper").css("padding-top", USABILITY_HINT_PADDING); // Account for usability hint $(".wrapper").css("padding-top", USABILITY_HINT_PADDING); // Account for usability hint
} }
}); });
@ -208,6 +204,6 @@ function getUsabilityHint() {
$(document).mouseup(function (e) { $(document).mouseup(function (e) {
var mb = $("#menu-btn"), w = $(window).width(); var mb = $("#menu-btn"), w = $(window).width();
if (!mb.is(e.target) && mb.has(e.target).length === 0 && w <= 970) { if (!mb.is(e.target) && mb.has(e.target).length === 0 && w <= 970) {
$('#nav .responsive-menu').slideUp(); $('#nav').find('.responsive-menu').slideUp();
} }
}); });

View file

@ -17,4 +17,19 @@ function setupLiveChat() {
$(document).ready(function() { $(document).ready(function() {
setupLiveChat(); setupLiveChat();
var lcLoadListener = setInterval(function() {
var ifr = document.getElementById('livechat-compact-container');
if (ifr !== undefined) {
LC_API.on_chat_state_changed = function(data) {
console.log('Chat state changed to: ' + data.state);
if (data.state == 'offline') {
$('.wrapper').css('padding-bottom', 10);
} else {
$('.wrapper').css('padding-bottom', 40);
}
};
clearInterval(lcLoadListener);
}
}, 100);
}); });