@@ -63,7 +63,7 @@ $(()=> {
6363 $menubar . appendTo ( "#menubar-example" ) ;
6464
6565 var $app_window_1 = new $Window ( { title : "Application Window" , resizable : true } ) ;
66- $app_window_1 . $content . append ( $ ( "#app-window-example-content" ) ) ;
66+ $app_window_1 . $content . append ( $ ( "#app-window-example-content" ) . attr ( "hidden" , null ) ) ;
6767
6868 $app_window_1 . $Button ( "Open Another Window" , ( ) => {
6969 var $new_window = new $Window ( { title : "Testing, Testing, 123" } ) ;
@@ -74,7 +74,7 @@ $(()=> {
7474 } ) ;
7575
7676 var $tool_window_1 = new $Window ( { title : "Tool Window" , toolWindow : true } ) ;
77- $tool_window_1 . $content . append ( $ ( "#tool-window-example-content" ) ) ;
77+ $tool_window_1 . $content . append ( $ ( "#tool-window-example-content" ) . attr ( "hidden" , null ) ) ;
7878 $tool_window_1 . on ( "close" , ( event ) => {
7979 event . preventDefault ( ) ;
8080 } ) ;
@@ -196,4 +196,18 @@ InfoWindow=255 255 225
196196 // });
197197 }
198198
199+ // Users of library: DON'T WORRY ABOUT THIS STUFF
200+ // This is just for the demo page, to prevent scroll jank when loading the page.
201+ // This is only needed because of all the dynamic content that is interspersed with text.
202+ // Usually you would have floating windows, that aren't trying to also fit into a document.
203+ let static_styles = "" ;
204+ for ( selector of window_list . map ( ( [ , el_id ] ) => `#${ el_id } ` ) . concat ( [
205+ "#scrollbar-demos" ,
206+ "#menubar-example" ,
207+ ] ) ) {
208+ const el = $ ( selector ) [ 0 ] ;
209+ static_styles += `${ selector } { width: ${ el . offsetWidth } px; height: ${ el . offsetHeight } px; }\n` ;
210+ }
211+ window . static_styles = static_styles ; // export these static styles to the demo's HTML (manually)
212+
199213} ) ;
0 commit comments