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 (){
changeTopStrMobile()
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) {
let type = typeof data
return type
@@ -76,9 +88,9 @@ function getInfoAboutUser (){
let user_type = ''
if (screen.width <= 700){
user_type = 'mobile'
} else if (screen.width > 1024) {
} else if (screen.width > 1180) {
user_type = 'desctop'
} else if (screen.width > 700 && screen.width < 1024) {
} else if (screen.width > 700 && screen.width <= 1180) {
user_type = 'laptop'
}
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(".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",
});
}
// document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'center',inline: 'start'});
let top = document.querySelector(".tab_user_messanger.select").offsetTop
document.querySelector(".menu_buttons.curtain.left.open").scrollTo({top:top})
// 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")