@@ -167,6 +167,7 @@ export default class UserInterface {
167167 this . _messagePosition = 'right' ;
168168 this . _messagePaneWidth = 420 ;
169169 this . _resizingMessagePane = false ;
170+ this . _mobileStackLayout = false ;
170171 this . _uiPreferencesKey = 'dasher-ui-preferences' ;
171172 this . _gameMode = false ;
172173 this . _gameTarget = '' ;
@@ -893,6 +894,13 @@ export default class UserInterface {
893894 }
894895 }
895896
897+ _update_mobile_layout ( ) {
898+ const width = this . _parent . getBoundingClientRect ( ) . width ;
899+ const forceStack = width <= 1100 ;
900+ this . _mobileStackLayout = forceStack ;
901+ this . _parent . classList . toggle ( 'ui-mobile-stack' , forceStack ) ;
902+ }
903+
896904 _attach_message_resizer ( ) {
897905 if ( this . _messageResizeHandle === undefined || this . _mainArea === undefined ) {
898906 return ;
@@ -1708,6 +1716,7 @@ export default class UserInterface {
17081716 }
17091717
17101718 _finish_load ( ) {
1719+ this . _update_mobile_layout ( ) ;
17111720 this . _limits . svgPiece = this . _svg ;
17121721 this . _on_resize ( ) ;
17131722 window . addEventListener ( 'resize' , this . _on_resize . bind ( this ) ) ;
@@ -2017,6 +2026,7 @@ export default class UserInterface {
20172026 }
20182027
20192028 _on_resize ( ) {
2029+ this . _update_mobile_layout ( ) ;
20202030 this . svgRect = this . _svg . node . getBoundingClientRect ( ) ;
20212031
20222032 if ( this . _controller !== null ) {
0 commit comments