@@ -536,10 +536,16 @@ define( [
536
536
return { x : x , y : y } ;
537
537
} ,
538
538
539
+ _reposition : function ( o ) {
540
+ // We only care about position-related parameters for repositioning
541
+ o = { x : o . x , y : o . y , positionTo : o . positionTo } ;
542
+ this . _trigger ( "beforeposition" , o ) ;
543
+ this . _ui . container . offset ( this . _placementCoords ( this . _desiredCoords ( o ) ) ) ;
544
+ } ,
545
+
539
546
reposition : function ( o ) {
540
547
if ( this . _isOpen ) {
541
- this . _trigger ( "beforeposition" ) ;
542
- this . _ui . container . offset ( this . _placementCoords ( this . _desiredCoords ( o ) ) ) ;
548
+ this . _reposition ( o ) ;
543
549
}
544
550
} ,
545
551
@@ -553,8 +559,7 @@ define( [
553
559
} ,
554
560
555
561
_open : function ( options ) {
556
- var coords ,
557
- o = $ . extend ( { } , this . options , options ) ,
562
+ var o = $ . extend ( { } , this . options , options ) ,
558
563
// TODO move blacklist to private method
559
564
androidBlacklist = ( function ( ) {
560
565
var w = window ,
@@ -573,11 +578,6 @@ define( [
573
578
return false ;
574
579
} ( ) ) ;
575
580
576
- // Give applications a chance to modify the contents of the container before it appears
577
- this . _trigger ( "beforeposition" ) ;
578
-
579
- coords = this . _placementCoords ( this . _desiredCoords ( o ) ) ;
580
-
581
581
// Count down to triggering "popupafteropen" - we have two prerequisites:
582
582
// 1. The popup window animation completes (container())
583
583
// 2. The screen opacity animation completes (screen())
@@ -594,10 +594,10 @@ define( [
594
594
}
595
595
596
596
this . _ui . screen . removeClass ( "ui-screen-hidden" ) ;
597
+ this . _ui . container . removeClass ( "ui-popup-hidden" ) ;
597
598
598
- this . _ui . container
599
- . removeClass ( "ui-popup-hidden" )
600
- . offset ( coords ) ;
599
+ // Give applications a chance to modify the contents of the container before it appears
600
+ this . _reposition ( o ) ;
601
601
602
602
if ( this . options . overlayTheme && androidBlacklist ) {
603
603
/* TODO:
0 commit comments