From 33c028207a3962fcfc88edcd10058d7e29e0a9f4 Mon Sep 17 00:00:00 2001 From: SBD Date: Thu, 1 Feb 2024 14:36:08 +0300 Subject: [PATCH] 6 --- static/js/global_js.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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}) } }