1- import utils from "../../services/utils.js" ;
2- import type BasicWidget from "../basic_widget.js" ;
1+ import { EventData } from "../../components/app_context.js" ;
32import FlexContainer from "./flex_container.js" ;
3+ import options from "../../services/options.js" ;
4+ import type BasicWidget from "../basic_widget.js" ;
5+ import utils from "../../services/utils.js" ;
46
57/**
68 * The root container is the top-most widget/container, from which the entire layout derives.
@@ -27,15 +29,45 @@ export default class RootContainer extends FlexContainer<BasicWidget> {
2729 window . visualViewport ?. addEventListener ( "resize" , ( ) => this . #onMobileResize( ) ) ;
2830 }
2931
32+ this . #setMotion( options . is ( "motionEnabled" ) ) ;
33+ this . #setShadows( options . is ( "shadowsEnabled" ) ) ;
34+ this . #setBackdropEffects( options . is ( "backdropEffectsEnabled" ) ) ;
35+
3036 return super . render ( ) ;
3137 }
3238
39+ entitiesReloadedEvent ( { loadResults } : EventData < "entitiesReloaded" > ) {
40+ if ( loadResults . isOptionReloaded ( "motionEnabled" ) ) {
41+ this . #setMotion( options . is ( "motionEnabled" ) ) ;
42+ }
43+
44+ if ( loadResults . isOptionReloaded ( "shadowsEnabled" ) ) {
45+ this . #setShadows( options . is ( "shadowsEnabled" ) ) ;
46+ }
47+
48+ if ( loadResults . isOptionReloaded ( "backdropEffectsEnabled" ) ) {
49+ this . #setBackdropEffects( options . is ( "backdropEffectsEnabled" ) ) ;
50+ }
51+ }
52+
3353 #onMobileResize( ) {
3454 const currentViewportHeight = getViewportHeight ( ) ;
3555 const isKeyboardOpened = ( currentViewportHeight < this . originalViewportHeight ) ;
3656 this . $widget . toggleClass ( "virtual-keyboard-opened" , isKeyboardOpened ) ;
3757 }
3858
59+ #setMotion( enabled : boolean ) {
60+ document . body . classList . toggle ( "motion-disabled" , ! enabled ) ;
61+ jQuery . fx . off = ! enabled ;
62+ }
63+
64+ #setShadows( enabled : boolean ) {
65+ document . body . classList . toggle ( "shadows-disabled" , ! enabled ) ;
66+ }
67+
68+ #setBackdropEffects( enabled : boolean ) {
69+ document . body . classList . toggle ( "backdrop-effects-disabled" , ! enabled ) ;
70+ }
3971}
4072
4173function getViewportHeight ( ) {
0 commit comments