mobile === false

This commit is contained in:
SBD
2023-12-29 12:49:13 +05:00
parent 1dae86f0e7
commit f80e2844bf
2 changed files with 50 additions and 22 deletions

View File

@@ -45,13 +45,13 @@ function select_tab_profile (el,url,owner_type=null) {
let confirm_url_f_lang_ru = ''
let confirm_url_f_lang_en = ''
if (owner_type){
window.history.pushState(null, null, `/${document.documentElement.lang}/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}/?mobile=${getInfoAboutUser() === 'mobile'}`)
confirm_url_f_lang_ru = `/ru/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}/?mobile=${getInfoAboutUser() === 'mobile'}`
confirm_url_f_lang_en = `/en/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}/?mobile=${getInfoAboutUser() === 'mobile'}`
window.history.pushState(null, null, `/${document.documentElement.lang}/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}`)
confirm_url_f_lang_ru = `/ru/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}/`
confirm_url_f_lang_en = `/en/profile/page/${profile_tabs_f_static_map.get(`${url}_${owner_type}`)}/`
} else {
window.history.pushState(null, null, `/${document.documentElement.lang}/profile/page/${profile_tabs_f_static_map.get(url)}/?mobile=${getInfoAboutUser() === 'mobile'}`)
confirm_url_f_lang_ru = `/ru/profile/page/${profile_tabs_f_static_map.get(url)}/?mobile=${getInfoAboutUser() === 'mobile'}`
confirm_url_f_lang_en = `/en/profile/page/${profile_tabs_f_static_map.get(url)}/?mobile=${getInfoAboutUser() === 'mobile'}`
window.history.pushState(null, null, `/${document.documentElement.lang}/profile/page/${profile_tabs_f_static_map.get(url)}/`)
confirm_url_f_lang_ru = `/ru/profile/page/${profile_tabs_f_static_map.get(url)}/`
confirm_url_f_lang_en = `/en/profile/page/${profile_tabs_f_static_map.get(url)}/`
}
document.querySelector("#ru_lang").href = confirm_url_f_lang_ru
document.querySelector("#en_lang").href = confirm_url_f_lang_en
@@ -116,7 +116,7 @@ function clickONTHEAPROfileBTN (el) {
function changeHrefCl (el) {
let dataset = el.dataset
let old_href = dataset['href']
let new_href = old_href + `?mobile=${getInfoAboutUser() === 'mobile'}`
let new_href = old_href
el.setAttribute('href',new_href)
}
@@ -534,6 +534,13 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){
document.querySelector(".enter-message-inp").focus()
document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'end',inline:'end'});
if (getInfoAboutUser() === 'mobile' || getInfoAboutUser() === 'laptop'){
window.scrollTo({
top: 0,
left: 0
// behavior: "smooth",
});
}
// if (window.location.host.includes('support') && user_type !== 'mobile' && user_type !== 'laptop'){
// let menu = document.querySelector(".menu_buttons.curtain.left")
// let container_user_messenger = document.querySelector(".container-messenger")
@@ -856,7 +863,7 @@ function set_curtain_z_index (curtain) {
}
function close_open_curtain () {
if (getInfoAboutUser() === 'mobile' || !window.location.href.includes("profile")){
if (getInfoAboutUser() === 'mobile' || getInfoAboutUser() === 'laptop' || !window.location.href.includes("profile")){
let curtains = document.querySelectorAll('.curtain.open')
if (curtains.length >= 2) {
if (last_open_curtain) {