Fix language change tooltip positioning
Use OOjs UI PopupWidget's new built-in positioning to position the popup relative to the ULS trigger. Bug: T161203 Change-Id: I3af45e2e3dbaea5f2e6435dd919a8bc7374e486e
This commit is contained in:
@@ -193,17 +193,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showTipsy( timeout ) {
|
function showTipsy( timeout ) {
|
||||||
var offset, tipsyTimer = 0;
|
var tipsyTimer = 0;
|
||||||
|
|
||||||
// Position popup
|
|
||||||
offset = $ulsTrigger.offset();
|
|
||||||
ulsPopup.$element.css( {
|
|
||||||
top: offset.top + 24,
|
|
||||||
left: offset.left + $ulsTrigger.outerWidth() / 2
|
|
||||||
} );
|
|
||||||
|
|
||||||
ulsPopup.toggle( true );
|
ulsPopup.toggle( true );
|
||||||
ulsPopup.toggleClipping( false );
|
ulsPopup.toggleClipping( false );
|
||||||
|
// Position popup
|
||||||
|
ulsPopup.setFloatableContainer( $ulsTrigger );
|
||||||
|
|
||||||
// if the mouse is over the tooltip, do not hide
|
// if the mouse is over the tooltip, do not hide
|
||||||
$( '.uls-tipsy' ).on( 'mouseover', function () {
|
$( '.uls-tipsy' ).on( 'mouseover', function () {
|
||||||
window.clearTimeout( tipsyTimer );
|
window.clearTimeout( tipsyTimer );
|
||||||
@@ -242,7 +238,6 @@
|
|||||||
ulsPopup = new OO.ui.PopupWidget( {
|
ulsPopup = new OO.ui.PopupWidget( {
|
||||||
padded: true,
|
padded: true,
|
||||||
width: 300,
|
width: 300,
|
||||||
align: 'forwards',
|
|
||||||
classes: [ 'uls-tipsy' ],
|
classes: [ 'uls-tipsy' ],
|
||||||
$content: ( function () {
|
$content: ( function () {
|
||||||
var link = $( '<a>' ).text( previousAutonym )
|
var link = $( '<a>' ).text( previousAutonym )
|
||||||
|
|||||||
Reference in New Issue
Block a user