Nikerabbit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/310745

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, 9 insertions(+), 7 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector 
refs/changes/45/310745/1

diff --git a/resources/js/ext.uls.interface.js 
b/resources/js/ext.uls.interface.js
index e9c6952..855f4b7 100644
--- a/resources/js/ext.uls.interface.js
+++ b/resources/js/ext.uls.interface.js
@@ -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: newchange
Gerrit-Change-Id: I527fc62b196e55101950cffcc6ec43926f63aa4a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com>

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

Reply via email to