mobile === false

This commit is contained in:
SBD
2023-12-29 19:45:43 +05:00
parent f80e2844bf
commit b31241872f
2 changed files with 26 additions and 11 deletions

View File

@@ -9,7 +9,8 @@
window.onload = function (){ window.onload = function (){
changeTopStrMobile() changeTopStrMobile()
middleWareJS() middleWareJS()
openOrCloseCurtainSupportChat()
openOverlayOrClose()
} }
// //
@@ -66,6 +67,17 @@ function openOrCloseCurtainSupportChat (){
} }
} }
function openOverlayOrClose () {
if (window.location.href.includes("profile")){
let overlay = document.querySelector('.block_overlay')
if (screen.width < 700){
if (!overlay.classList.contains("show")){
overlay.classList.add("show")
}
}
}
}
function getTypeOfData (data) { function getTypeOfData (data) {
let type = typeof data let type = typeof data
return type return type
@@ -76,9 +88,9 @@ function getInfoAboutUser (){
let user_type = '' let user_type = ''
if (screen.width <= 700){ if (screen.width <= 700){
user_type = 'mobile' user_type = 'mobile'
} else if (screen.width > 1024) { } else if (screen.width > 1180) {
user_type = 'desctop' user_type = 'desctop'
} else if (screen.width > 700 && screen.width < 1024) { } else if (screen.width > 700 && screen.width <= 1180) {
user_type = 'laptop' user_type = 'laptop'
} }
return user_type return user_type

View File

@@ -533,14 +533,17 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){
document.querySelector(".info_profile").innerHTML = data.html; document.querySelector(".info_profile").innerHTML = data.html;
document.querySelector(".enter-message-inp").focus() document.querySelector(".enter-message-inp").focus()
document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'end',inline:'end'}); // document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'center',inline: 'start'});
if (getInfoAboutUser() === 'mobile' || getInfoAboutUser() === 'laptop'){ let top = document.querySelector(".tab_user_messanger.select").offsetTop
window.scrollTo({ document.querySelector(".menu_buttons.curtain.left.open").scrollTo({top:top})
top: 0,
left: 0 // if (getInfoAboutUser() === 'mobile' || getInfoAboutUser() === 'laptop'){
// behavior: "smooth", // window.scrollTo({
}); // top: 0,
} // left: 0
// // behavior: "smooth",
// });
// }
// if (window.location.host.includes('support') && user_type !== 'mobile' && user_type !== 'laptop'){ // if (window.location.host.includes('support') && user_type !== 'mobile' && user_type !== 'laptop'){
// let menu = document.querySelector(".menu_buttons.curtain.left") // let menu = document.querySelector(".menu_buttons.curtain.left")
// let container_user_messenger = document.querySelector(".container-messenger") // let container_user_messenger = document.querySelector(".container-messenger")