File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,17 @@ <h1>JSONLab</h1>
5353 < i data-lucide ="moon " id ="theme-icon "> </ i >
5454 </ button >
5555 </ div >
56+ < script >
57+ // prevent FOUC: activate the correct mode button before first paint
58+ ( function ( ) {
59+ var mode = localStorage . getItem ( 'jsonlab_global_view_mode' ) || 'normal' ;
60+ if ( mode !== 'normal' ) {
61+ document . getElementById ( 'btn-mode-normal' ) . classList . remove ( 'active' ) ;
62+ var btn = document . getElementById ( 'btn-mode-' + mode ) ;
63+ if ( btn ) btn . classList . add ( 'active' ) ;
64+ }
65+ } ) ( ) ;
66+ </ script >
5667 </ header >
5768
5869 <!-- Main Editor Area -->
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ const App = {
5151 rightContainer . className = 'editor-wrapper' ;
5252 rightContainer . id = 'editor-wrapper-right' ;
5353 rightContainer . style . flex = '1' ;
54- rightContainer . style . display = 'flex' ;
54+ rightContainer . style . display = 'none' ; // hidden until switchGlobalMode sets the correct layout
5555 rightContainer . style . flexDirection = 'column' ;
5656 rightContainer . style . minWidth = '0' ;
5757 container . appendChild ( rightContainer ) ;
You can’t perform that action at this time.
0 commit comments