From 14141573383426968b5cb410a09ffb7cd6c48f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Tue, 4 Apr 2017 01:28:03 +0200 Subject: [PATCH] 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 --- resources/js/ext.uls.interface.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/resources/js/ext.uls.interface.js b/resources/js/ext.uls.interface.js index 93243280..e7114cdb 100644 --- a/resources/js/ext.uls.interface.js +++ b/resources/js/ext.uls.interface.js @@ -193,17 +193,13 @@ } function showTipsy( timeout ) { - var offset, tipsyTimer = 0; - - // Position popup - offset = $ulsTrigger.offset(); - ulsPopup.$element.css( { - top: offset.top + 24, - left: offset.left + $ulsTrigger.outerWidth() / 2 - } ); + var tipsyTimer = 0; ulsPopup.toggle( true ); ulsPopup.toggleClipping( false ); + // Position popup + ulsPopup.setFloatableContainer( $ulsTrigger ); + // if the mouse is over the tooltip, do not hide $( '.uls-tipsy' ).on( 'mouseover', function () { window.clearTimeout( tipsyTimer ); @@ -242,7 +238,6 @@ ulsPopup = new OO.ui.PopupWidget( { padded: true, width: 300, - align: 'forwards', classes: [ 'uls-tipsy' ], $content: ( function () { var link = $( '' ).text( previousAutonym )