@@ -266,8 +266,6 @@ $.widget("ui.dialog", {
266
266
this . _trigger ( "close" , event ) ;
267
267
}
268
268
269
- $ . ui . dialog . overlay . resize ( ) ;
270
-
271
269
return this ;
272
270
} ,
273
271
@@ -387,7 +385,6 @@ $.widget("ui.dialog", {
387
385
$ ( this )
388
386
. removeClass ( "ui-dialog-dragging" ) ;
389
387
that . _trigger ( "dragStop" , event , filteredUi ( ui ) ) ;
390
- $ . ui . dialog . overlay . resize ( ) ;
391
388
}
392
389
} ) ;
393
390
} ,
@@ -433,7 +430,6 @@ $.widget("ui.dialog", {
433
430
options . height = $ ( this ) . height ( ) ;
434
431
options . width = $ ( this ) . width ( ) ;
435
432
that . _trigger ( "resizeStop" , event , filteredUi ( ui ) ) ;
436
- $ . ui . dialog . overlay . resize ( ) ;
437
433
}
438
434
} )
439
435
. css ( "position" , position )
@@ -662,18 +658,13 @@ $.extend( $.ui.dialog.overlay, {
662
658
oldInstances : [ ] ,
663
659
maxZ : 0 ,
664
660
events : $ . map (
665
- "focus, mousedown,mouseup, keydown, keypress,click " . split ( ", " ) ,
661
+ "focus mousedown keydown keypress" . split ( " " ) ,
666
662
function ( event ) {
667
663
return event + ".dialog-overlay" ;
668
664
}
669
665
) . join ( " " ) ,
670
666
create : function ( dialog ) {
671
667
672
- if ( this . instances . length === 0 ) {
673
- // handle window resize
674
- $ ( window ) . bind ( "resize.dialog-overlay" , $ . ui . dialog . overlay . resize ) ;
675
- }
676
-
677
668
var $el = ( this . oldInstances . pop ( ) || $ ( "<div>" ) . addClass ( "ui-widget-overlay" ) ) ;
678
669
679
670
// allow closing by pressing the escape key
@@ -689,10 +680,7 @@ $.extend( $.ui.dialog.overlay, {
689
680
}
690
681
} ) ;
691
682
692
- $el . appendTo ( document . body ) . css ( {
693
- width : this . width ( ) ,
694
- height : this . height ( )
695
- } ) ;
683
+ $el . appendTo ( document . body ) ;
696
684
697
685
if ( $ . fn . bgiframe ) {
698
686
$el . bgiframe ( ) ;
@@ -717,78 +705,6 @@ $.extend( $.ui.dialog.overlay, {
717
705
$el . height ( 0 ) . width ( 0 ) . remove ( ) ;
718
706
} ,
719
707
720
- height : function ( ) {
721
- var scrollHeight ,
722
- offsetHeight ;
723
- // handle IE
724
- if ( $ . ui . ie ) {
725
- scrollHeight = Math . max (
726
- document . documentElement . scrollHeight ,
727
- document . body . scrollHeight
728
- ) ;
729
- offsetHeight = Math . max (
730
- document . documentElement . offsetHeight ,
731
- document . body . offsetHeight
732
- ) ;
733
-
734
- if ( scrollHeight < offsetHeight ) {
735
- return $ ( window ) . height ( ) + "px" ;
736
- } else {
737
- return scrollHeight + "px" ;
738
- }
739
- // handle "good" browsers
740
- } else {
741
- return $ ( document ) . height ( ) + "px" ;
742
- }
743
- } ,
744
-
745
- width : function ( ) {
746
- var scrollWidth ,
747
- offsetWidth ;
748
- // handle IE
749
- if ( $ . ui . ie ) {
750
- scrollWidth = Math . max (
751
- document . documentElement . scrollWidth ,
752
- document . body . scrollWidth
753
- ) ;
754
- offsetWidth = Math . max (
755
- document . documentElement . offsetWidth ,
756
- document . body . offsetWidth
757
- ) ;
758
-
759
- if ( scrollWidth < offsetWidth ) {
760
- return $ ( window ) . width ( ) + "px" ;
761
- } else {
762
- return scrollWidth + "px" ;
763
- }
764
- // handle "good" browsers
765
- } else {
766
- return $ ( document ) . width ( ) + "px" ;
767
- }
768
- } ,
769
-
770
- resize : function ( ) {
771
- /* If the dialog is draggable and the user drags it past the
772
- * right edge of the window, the document becomes wider so we
773
- * need to stretch the overlay. If the user then drags the
774
- * dialog back to the left, the document will become narrower,
775
- * so we need to shrink the overlay to the appropriate size.
776
- * This is handled by shrinking the overlay before setting it
777
- * to the full document size.
778
- */
779
- var $overlays = $ ( [ ] ) ;
780
- $ . each ( $ . ui . dialog . overlay . instances , function ( ) {
781
- $overlays = $overlays . add ( this ) ;
782
- } ) ;
783
-
784
- $overlays . css ( {
785
- width : 0 ,
786
- height : 0
787
- } ) . css ( {
788
- width : $ . ui . dialog . overlay . width ( ) ,
789
- height : $ . ui . dialog . overlay . height ( )
790
- } ) ;
791
- }
792
708
} ) ;
793
709
794
710
$ . extend ( $ . ui . dialog . overlay . prototype , {
0 commit comments