diff --git a/static/js/global_js.js b/static/js/global_js.js index f133cba..8435ca7 100644 --- a/static/js/global_js.js +++ b/static/js/global_js.js @@ -46,8 +46,11 @@ window.onload = function (){ // function goToChatIfChat () { if (document.querySelector('.block-chat')){ - let chat = document.querySelector('.block-chat') - let top = chat.offsetTop + let scroll_el = document.querySelector('.block-chat') + if (document.querySelector(".name_ticket")){ + scroll_el = document.querySelector(".name_ticket") + } + let top = scroll_el.offsetTop window.scrollTo({top:top}) } }