@@ -11,7 +11,6 @@ const WIDGET_OPEN_HEIGHT = 525;
1111const WIDGET_MINIMIZED_WIDTH = 54 ;
1212const WIDGET_MINIMIZED_HEIGHT = 54 ;
1313const WIDGET_MARGIN = 16 ;
14- const FULLSCREEN_DOCUMENT_CONFIG = 'overflow: hidden; height: 100%; width: 100%;' ;
1514
1615
1716window . RocketChat = window . RocketChat || { _ : [ ] } ;
@@ -21,7 +20,6 @@ let iframe;
2120let hookQueue = [ ] ;
2221let ready = false ;
2322let smallScreen = false ;
24- let bodyStyle ;
2523let scrollPosition ;
2624let widget_height ;
2725
@@ -74,10 +72,9 @@ function callHook(action, params) {
7472const updateWidgetStyle = ( isOpened ) => {
7573 if ( smallScreen && isOpened ) {
7674 scrollPosition = document . documentElement . scrollTop ;
77- bodyStyle = document . body . style . cssText ;
78- document . body . style . cssText += FULLSCREEN_DOCUMENT_CONFIG ;
75+ document . body . classList . add ( 'rc-livechat-mobile-full-screen' ) ;
7976 } else {
80- document . body . style . cssText = bodyStyle ;
77+ document . body . classList . remove ( 'rc-livechat-mobile-full-screen' ) ;
8178 if ( smallScreen ) {
8279 document . documentElement . scrollTop = scrollPosition ;
8380 }
@@ -235,11 +232,11 @@ const api = {
235232 } ,
236233
237234 resetDocumentStyle ( ) {
238- document . body . style . cssText = bodyStyle ;
235+ document . body . classList . remove ( 'rc-livechat-mobile-full-screen' ) ;
239236 } ,
240237
241238 setFullScreenDocumentMobile ( ) {
242- document . body . style . cssText += smallScreen && FULLSCREEN_DOCUMENT_CONFIG ;
239+ smallScreen && document . body . classList . add ( 'rc-livechat-mobile-full-screen' ) ;
243240 } ,
244241} ;
245242
0 commit comments