@ -188,36 +188,56 @@ export class AppImManager {
// * fix topbar overflow section
// * fix topbar overflow section
const setUtilsWidth = ( ) = > {
const observeOptions = {
const width = /* chatUtils.scrollWidth */ chatUtils . getBoundingClientRect ( ) . width ;
attributes : true ,
this . log ( 'utils width:' , width ) ;
childList : true ,
this . chatInfo . style . setProperty ( '--utils-width' , width + 'px' ) ;
subtree : true
} ;
} ;
let mutationRAF : number ;
// ! У МЕНЯ ПРОСТО СГОРЕЛО, САФАРИ КОНЧЕННЫЙ БРАУЗЕР - ЕСЛИ НЕ СКРЫВАТЬ БЛОК, ТО ПРИ ПЕРЕВОРОТЕ ЭКРАНА НА АЙФОНЕ БЛОК БУДЕТ НЕПРАВИЛЬНО ШИРИНЫ, ДАЖЕ БЕЗ ЭТОЙ ФУНКЦИИ!
const mutationObserver = new MutationObserver ( ( mutationList ) = > {
const setUtilsWidth = ( ) = > {
//return;
if ( mutationRAF ) window . cancelAnimationFrame ( mutationRAF ) ;
if ( mutationRAF ) window . cancelAnimationFrame ( mutationRAF ) ;
//mutationRAF = window.setTimeout(() => {
chatUtils . classList . add ( 'hide' ) ;
mutationObserver . disconnect ( ) ;
mutationRAF = window . requestAnimationFrame ( ( ) = > {
mutationRAF = window . requestAnimationFrame ( ( ) = > {
//mutationRAF = window.requestAnimationFrame(() => {
//mutationRAF = window.requestAnimationFrame(() => {
setUtilsWidth ( ) ;
//setTimeout(() => {
chatUtils . classList . remove ( 'hide' ) ;
/ * t h i s . c h a t I n f o . s t y l e . r e m o v e P r o p e r t y ( ' - - u t i l s - w i d t h ' ) ;
void this . chatInfo . offsetLeft ; // reflow */
const width = /* chatUtils.scrollWidth */ chatUtils . getBoundingClientRect ( ) . width ;
this . log ( 'utils width:' , width ) ;
this . chatInfo . style . setProperty ( '--utils-width' , width + 'px' ) ;
//this.chatInfo.classList.toggle('have-utils-width', !!width);
//}, 0);
mutationRAF = 0 ;
mutationObserver . observe ( chatUtils , observeOptions ) ;
//});
//});
} ) ;
} ) ;
//}, 64);
} ;
/ * w i n d o w . a d d E v e n t L i s t e n e r ( ' r e s i z e ' , ( ) = > {
setTimeout ( setUtilsWidth , 5000 ) ;
} ) ; * /
let mutationRAF : number ;
const mutationObserver = new MutationObserver ( ( mutationList ) = > {
setUtilsWidth ( ) ;
} ) ;
} ) ;
mutationObserver . observe ( chatUtils , {
mutationObserver . observe ( chatUtils , observeOptions ) ;
attributes : true ,
childList : true ,
subtree : true
} ) ;
mediaSizes . addListener ( 'changeScreen' , ( from , to ) = > {
mediaSizes . addListener ( 'changeScreen' , ( from , to ) = > {
setUtilsWidth ( ) ;
this . chatAudio . divAndCaption . container . classList . toggle ( 'is-floating' , to == ScreenSize . mobile ) ;
this . chatAudio . divAndCaption . container . classList . toggle ( 'is-floating' , to == ScreenSize . mobile ) ;
this . pinnedMessageContainer . divAndCaption . container . classList . toggle ( 'is-floating' , to == ScreenSize . mobile
this . pinnedMessageContainer . divAndCaption . container . classList . toggle ( 'is-floating' , to == ScreenSize . mobile
/* || (!this.chatAudio.divAndCaption.container.classList.contains('hide') && to == ScreenSize.medium) */ ) ;
/* || (!this.chatAudio.divAndCaption.container.classList.contains('hide') && to == ScreenSize.medium) */ ) ;
setUtilsWidth ( ) ;
} ) ;
} ) ;
// * fix topbar overflow section end
// * fix topbar overflow section end