Advertisement
livechatinc

CookieUpdatePadding

Jul 2nd, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // check if cookie panel is active and offset the live chat panel
  2. if ($('.cookieAcceptance').length) {
  3.  
  4. // check cookie panel outer height
  5. var cookiePanelHeight = $('.cookieAcceptance').outerHeight(true);
  6. // offset Footer
  7. $footer.css('padding-bottom', cookiePanelHeight + 20 + 'px');
  8.  
  9. var LC_API = LC_API || {};
  10. LC_API.on_after_load = function () {
  11. // Offset Live chat
  12. var $liveChatWrapper = $('#livechat-compact-container');
  13. var $liveChatFull = $('#livechat-full');
  14. $liveChatWrapper.addClass('live-chat cookie-visible');
  15. $liveChatFull.addClass('live-chat cookie-visible');
  16. $liveChatWrapper.css('bottom', cookiePanelHeight + 'px');
  17. $liveChatFull.css('bottom', cookiePanelHeight + 'px');
  18. if (LC_API.new_mobile_is_detected())
  19. {
  20.      $liveChatWrapper.css('transform', 'translateY(-'+cookiePanelHeight+'px)');
  21. }
  22.  
  23. }
  24. $(window).resize(function () {
  25. // check cookie panel outer height
  26. cookiePanelHeight = $('.cookieAcceptance').outerHeight(true);
  27.  
  28. // offset Footer
  29. $footer.css('padding-bottom', cookiePanelHeight + 20 + 'px');
  30.  
  31. // Offset Live chat
  32. var LC_API = LC_API || {};
  33. LC_API.on_after_load = function () {
  34. $liveChatWrapper.css('bottom', cookiePanelHeight + 'px');
  35. $liveChatFull.css('bottom', cookiePanelHeight + 'px');
  36. }
  37. });
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement