mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
Merge "Fix callout position when popup widget has been moved"
This commit is contained in:
commit
01a0ae93b9
|
@ -134,7 +134,7 @@ ve.ui.PopupWidget.prototype.hide = function () {
|
|||
*/
|
||||
ve.ui.PopupWidget.prototype.display = function ( x, y, width, height, transition ) {
|
||||
var left, overlapLeft, overlapRight,
|
||||
padding = 15;
|
||||
overlapOffset = 0, padding = 7;
|
||||
|
||||
switch ( this.align ) {
|
||||
case 'left':
|
||||
|
@ -155,9 +155,9 @@ ve.ui.PopupWidget.prototype.display = function ( x, y, width, height, transition
|
|||
overlapRight = this.$$( 'body' ).width() - ( x + ( width + left + ( padding * 2 ) ) );
|
||||
overlapLeft = x + ( left - ( padding * 2 ) );
|
||||
if ( overlapRight < 0 ) {
|
||||
left += overlapRight;
|
||||
overlapOffset = overlapRight;
|
||||
} else if ( overlapLeft < 0 ) {
|
||||
left -= overlapLeft;
|
||||
overlapOffset -= overlapLeft;
|
||||
}
|
||||
|
||||
// Prevent transition from being interrupted
|
||||
|
@ -176,7 +176,7 @@ ve.ui.PopupWidget.prototype.display = function ( x, y, width, height, transition
|
|||
|
||||
// Position body relative to anchor and adjust size
|
||||
this.$body.css( {
|
||||
'left': left, 'width': width, 'height': height === undefined ? 'auto' : height
|
||||
'left': left + overlapOffset, 'width': width, 'height': height === undefined ? 'auto' : height
|
||||
} );
|
||||
|
||||
return this;
|
||||
|
|
Loading…
Reference in a new issue