jenkins-bot has submitted this change and it was merged.

Change subject: Undo tooltip: position when shown, not when created
......................................................................


Undo tooltip: position when shown, not when created

Especially on Special:CX, where page layout changes soon after load
(for example scrollbars get added when more content loads), the tooltip
would be positioned incorrectly. Now it is more likely to be positioned
correctly, and will get re-positioned again if it is shown again after
being hidden.

Bug: T145483
Change-Id: I527fc62b196e55101950cffcc6ec43926f63aa4a
---
M resources/js/ext.uls.interface.js
1 file changed, 10 insertions(+), 8 deletions(-)

Approvals:
  Amire80: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/js/ext.uls.interface.js 
b/resources/js/ext.uls.interface.js
index e9c6952..910ac10 100644
--- a/resources/js/ext.uls.interface.js
+++ b/resources/js/ext.uls.interface.js
@@ -196,7 +196,7 @@
         * It also allows to undo the language selection.
         */
        function showUndoTooltip( previousLang, previousAutonym ) {
-               var $ulsTrigger, ulsPopup, offset,
+               var $ulsTrigger, ulsPopup,
                        ulsPosition = mw.config.get( 'wgULSPosition' );
 
                $ulsTrigger = ( ulsPosition === 'interlanguage' ) ?
@@ -208,7 +208,14 @@
                }
 
                function showTipsy( timeout ) {
-                       var tipsyTimer = 0;
+                       var offset, tipsyTimer = 0;
+
+                       // Position popup
+                       offset = $ulsTrigger.offset();
+                       ulsPopup.$element.css( {
+                               top: offset.top + 24,
+                               left: offset.left + $ulsTrigger.outerWidth() / 2
+                       } );
 
                        ulsPopup.toggle( true );
                        ulsPopup.toggleClipping( false );
@@ -276,12 +283,7 @@
                        }() )
                } );
 
-               // Position popup
-               offset = $ulsTrigger.offset();
-               ulsPopup.$element.css( {
-                       top: offset.top + 24,
-                       left: offset.left + $ulsTrigger.outerWidth() / 2
-               } ).appendTo( 'body' );
+               ulsPopup.$element.appendTo( 'body' );
 
                // The interlanguage position needs some time to settle down
                window.setTimeout( function () {

-- 
To view, visit https://gerrit.wikimedia.org/r/310745
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I527fc62b196e55101950cffcc6ec43926f63aa4a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to