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

Change subject: Match vector
......................................................................


Match vector

Change-Id: Icb0d40dc2f08596ea79be446111c434704a11b39
---
M js/vector.js
1 file changed, 14 insertions(+), 4 deletions(-)

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



diff --git a/js/vector.js b/js/vector.js
index 110f64c..7266a13 100644
--- a/js/vector.js
+++ b/js/vector.js
@@ -7,7 +7,17 @@
         */
        var $cactions = $( '#p-cactions' ),
                $tabContainer = $( '#p-views ul' ),
-               originalDropdownWidth = $cactions.width();
+               rAF = window.requestAnimationFrame || setTimeout,
+               // Avoid forced style calculation during page load
+               initialCactionsWidth = function () {
+                       var width = $cactions.width();
+                       initialCactionsWidth = function () {
+                               return width;
+                       };
+                       return width;
+               };
+
+       rAF( initialCactionsWidth );
 
        /**
         * Focus search input at the very end
@@ -49,7 +59,7 @@
                                $cactions
                                        .removeClass( 'emptyPortlet' )
                                        .find( 'h5' )
-                                               .css( 'width', '1px' ).animate( 
{ width: originalDropdownWidth }, 'normal' );
+                                               .css( 'width', '1px' ).animate( 
{ width: initialCactionsWidth() }, 'normal' );
                        }
                } )
                .bind( 'beforeTabExpand', function () {
@@ -74,7 +84,7 @@
                                        // Maybe we can still expand? Account 
for the width of the "Actions" dropdown if the
                                        // expansion would hide it.
                                        if ( $cactions.find( 'li' ).length === 
1 ) {
-                                               return distance >= eleWidth + 1 
- originalDropdownWidth;
+                                               return distance >= eleWidth + 1 
- initialCactionsWidth();
                                        } else {
                                                return false;
                                        }
@@ -90,7 +100,7 @@
                                        // But only if the width of the tab to 
collapse is smaller than the width of the dropdown
                                        // we would have to insert. An example 
language where this happens is Lithuanian (lt).
                                        if ( $cactions.hasClass( 'emptyPortlet' 
) ) {
-                                               return $tabContainer.children( 
'li.collapsible:last' ).width() > originalDropdownWidth;
+                                               return $tabContainer.children( 
'li.collapsible:last' ).width() > initialCactionsWidth();
                                        } else {
                                                return true;
                                        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb0d40dc2f08596ea79be446111c434704a11b39
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Metrolook
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com>
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