Permalink
Browse files

Merge branch 'master' of github.com:jquery/jquery-mobile

  • Loading branch information...
2 parents d8bef6b + 99efbff commit fc9daef8a391714f01b94f4a3a669366f260a04b @jefflembeck jefflembeck committed Jan 7, 2013
Showing with 12 additions and 12 deletions.
  1. +12 −12 js/widgets/popup.js
View
@@ -536,10 +536,16 @@ define( [
return { x: x, y: y };
},
+ _reposition: function( o ) {
+ // We only care about position-related parameters for repositioning
+ o = { x: o.x, y: o.y, positionTo: o.positionTo };
+ this._trigger( "beforeposition", o );
+ this._ui.container.offset( this._placementCoords( this._desiredCoords( o ) ) );
+ },
+
reposition: function( o ) {
if ( this._isOpen ) {
- this._trigger( "beforeposition" );
- this._ui.container.offset( this._placementCoords( this._desiredCoords( o ) ) );
+ this._reposition( o );
}
},
@@ -553,8 +559,7 @@ define( [
},
_open: function( options ) {
- var coords,
- o = $.extend( {}, this.options, options ),
+ var o = $.extend( {}, this.options, options ),
// TODO move blacklist to private method
androidBlacklist = ( function() {
var w = window,
@@ -573,11 +578,6 @@ define( [
return false;
}());
- // Give applications a chance to modify the contents of the container before it appears
- this._trigger( "beforeposition" );
-
- coords = this._placementCoords( this._desiredCoords( o ) );
-
// Count down to triggering "popupafteropen" - we have two prerequisites:
// 1. The popup window animation completes (container())
// 2. The screen opacity animation completes (screen())
@@ -594,10 +594,10 @@ define( [
}
this._ui.screen.removeClass( "ui-screen-hidden" );
+ this._ui.container.removeClass( "ui-popup-hidden" );
- this._ui.container
- .removeClass( "ui-popup-hidden" )
- .offset( coords );
+ // Give applications a chance to modify the contents of the container before it appears
+ this._reposition( o );
if ( this.options.overlayTheme && androidBlacklist ) {
/* TODO:

0 comments on commit fc9daef

Please sign in to comment.