File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- document . addEventListener ( 'DOMContentLoaded' , ( ) => {
1+ function initStudioApp ( ) {
22 // Navigation Tabs
33 const navButtons = document . querySelectorAll ( '.nav-btn' ) ;
44 const tabContents = document . querySelectorAll ( '.tab-content' ) ;
@@ -11,8 +11,8 @@ document.addEventListener('DOMContentLoaded', () => {
1111 btn . classList . add ( 'active' ) ;
1212 const targetEl = document . getElementById ( targetTab ) ;
1313 if ( targetEl ) targetEl . classList . add ( 'active' ) ;
14- if ( targetTab === 'tab-gallery' && typeof loadGallery === 'function' ) {
15- loadGallery ( ) ;
14+ if ( targetTab === 'tab-gallery' && typeof window . loadGallery === 'function' ) {
15+ window . loadGallery ( ) ;
1616 }
1717 } ) ;
1818 } ) ;
@@ -1187,4 +1187,10 @@ document.addEventListener('DOMContentLoaded', () => {
11871187 // Start live inline log polling immediately and every 2 seconds
11881188 pollInlineLogs ( ) ;
11891189 setInterval ( pollInlineLogs , 2000 ) ;
1190- } ) ;
1190+ }
1191+
1192+ if ( document . readyState === 'loading' ) {
1193+ document . addEventListener ( 'DOMContentLoaded' , initStudioApp ) ;
1194+ } else {
1195+ initStudioApp ( ) ;
1196+ }
You can’t perform that action at this time.
0 commit comments