Don't have Telegram yet? Try it now!
n checkActionsPosition() { var widget = document.getElementById('widget'); var widget_actions = document.getElementById('widget_actions'); var widget_rect = widget.getBoundingClientRect(); var actions_bottom = widget_rect.bottom + widget_actions.offsetHeight - 1; var client_bottom = window.innerHeight || html.clientHeight; if (actions_bottom > client_bottom) { widget.style.marginBottom = widget_actions.offsetHeight + 'px'; document.body.classList.add('fixed_actions'); } else { widget.style.marginBottom = ''; document.body.classList.remove('fixed_actions'); } } function postMessageHandler(event) { try { var data = JSON.parse(event.data); } catch(e) { var data = {}; } if (data.event == 'resize') { setTimeout(checkActionsPosition, 50); } } window.addEventListener('resize', checkActionsPosition); window.addEventListener('scroll', checkActionsPosition); window.addEventListener('message', postMessageHandler); n checkActionsPosition() { var widget = document.getElementById('widget'); var widget_actions = document.getElementById('widget_actions'); var widget_rect = widget.getBoundingClientRect(); var actions_bottom = widget_rect.bottom + widget_actions.offsetHeight - 1; var client_bottom = window.innerHeight || html.clientHeight;