Skip to content

Commit fc9daef

Browse files
committed
Merge branch 'master' of github.com:jquery/jquery-mobile
2 parents d8bef6b + 99efbff commit fc9daef

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

js/widgets/popup.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,16 @@ define( [
536536
return { x: x, y: y };
537537
},
538538

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+
539546
reposition: function( o ) {
540547
if ( this._isOpen ) {
541-
this._trigger( "beforeposition" );
542-
this._ui.container.offset( this._placementCoords( this._desiredCoords( o ) ) );
548+
this._reposition( o );
543549
}
544550
},
545551

@@ -553,8 +559,7 @@ define( [
553559
},
554560

555561
_open: function( options ) {
556-
var coords,
557-
o = $.extend( {}, this.options, options ),
562+
var o = $.extend( {}, this.options, options ),
558563
// TODO move blacklist to private method
559564
androidBlacklist = ( function() {
560565
var w = window,
@@ -573,11 +578,6 @@ define( [
573578
return false;
574579
}());
575580

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-
581581
// Count down to triggering "popupafteropen" - we have two prerequisites:
582582
// 1. The popup window animation completes (container())
583583
// 2. The screen opacity animation completes (screen())
@@ -594,10 +594,10 @@ define( [
594594
}
595595

596596
this._ui.screen.removeClass( "ui-screen-hidden" );
597+
this._ui.container.removeClass( "ui-popup-hidden" );
597598

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 );
601601

602602
if ( this.options.overlayTheme && androidBlacklist ) {
603603
/* TODO:

0 commit comments

Comments
 (0)