@@ -589,25 +589,55 @@ async function UIWindow(options) {
589
589
// window is actually appended and usable.
590
590
// NOTE: there is another is_visible condition below
591
591
if ( options . is_visible ) {
592
- $ ( el_window ) . show ( 0 , function ( e ) {
593
- // if SaveFileDialog, bring focus to the el_savefiledialog_filename and select all
594
- if ( options . is_saveFileDialog ) {
595
- let item_name = el_savefiledialog_filename . value ;
596
- const extname = path . extname ( '/' + item_name ) ;
597
- if ( extname !== '' )
598
- el_savefiledialog_filename . setSelectionRange ( 0 , item_name . length - extname . length )
599
- else
600
- $ ( el_savefiledialog_filename ) . select ( ) ;
601
-
602
- $ ( el_savefiledialog_filename ) . get ( 0 ) . focus ( { preventScroll :true } ) ;
603
- }
604
- //set custom window css
605
- $ ( el_window ) . css ( options . window_css ) ;
606
- // onAppend()
607
- if ( options . onAppend && typeof options . onAppend === 'function' ) {
608
- options . onAppend ( el_window ) ;
609
- }
610
- } ) ;
592
+
593
+ if ( options . fadeIn ) {
594
+ $ ( el_window ) . css ( 'opacity' , 0 ) ;
595
+
596
+ $ ( el_window ) . animate ( { opacity : 1 } , options . fadeIn , function ( ) {
597
+ // Move the onAppend callback here to ensure it's called after fade-in
598
+ if ( options . is_visible ) {
599
+ $ ( el_window ) . show ( 0 , function ( e ) {
600
+ // if SaveFileDialog, bring focus to the el_savefiledialog_filename and select all
601
+ if ( options . is_saveFileDialog ) {
602
+ let item_name = el_savefiledialog_filename . value ;
603
+ const extname = path . extname ( '/' + item_name ) ;
604
+ if ( extname !== '' )
605
+ el_savefiledialog_filename . setSelectionRange ( 0 , item_name . length - extname . length ) ;
606
+ else
607
+ $ ( el_savefiledialog_filename ) . select ( ) ;
608
+
609
+ $ ( el_savefiledialog_filename ) . get ( 0 ) . focus ( { preventScroll :true } ) ;
610
+ }
611
+ //set custom window css
612
+ $ ( el_window ) . css ( options . window_css ) ;
613
+ // onAppend()
614
+ if ( options . onAppend && typeof options . onAppend === 'function' ) {
615
+ options . onAppend ( el_window ) ;
616
+ }
617
+ } ) ;
618
+ }
619
+ } ) ;
620
+ } else {
621
+ $ ( el_window ) . show ( 0 , function ( e ) {
622
+ // if SaveFileDialog, bring focus to the el_savefiledialog_filename and select all
623
+ if ( options . is_saveFileDialog ) {
624
+ let item_name = el_savefiledialog_filename . value ;
625
+ const extname = path . extname ( '/' + item_name ) ;
626
+ if ( extname !== '' )
627
+ el_savefiledialog_filename . setSelectionRange ( 0 , item_name . length - extname . length )
628
+ else
629
+ $ ( el_savefiledialog_filename ) . select ( ) ;
630
+
631
+ $ ( el_savefiledialog_filename ) . get ( 0 ) . focus ( { preventScroll :true } ) ;
632
+ }
633
+ //set custom window css
634
+ $ ( el_window ) . css ( options . window_css ) ;
635
+ // onAppend()
636
+ if ( options . onAppend && typeof options . onAppend === 'function' ) {
637
+ options . onAppend ( el_window ) ;
638
+ }
639
+ } ) ;
640
+ }
611
641
}
612
642
613
643
if ( options . is_saveFileDialog ) {
0 commit comments