From 7f87f040c074013eda2a057266cc1353061b322f Mon Sep 17 00:00:00 2001 From: giomba Date: Sun, 9 May 2021 21:45:58 +0200 Subject: [PATCH] removed code which handles collapsible tabs --- collapsibleTabs.js | 28 ---------------------------- jsduck.json | 1 - skin.json | 1 - vector.js | 24 +----------------------- 4 files changed, 1 insertion(+), 53 deletions(-) diff --git a/collapsibleTabs.js b/collapsibleTabs.js index 33e8967..de5baf5 100644 --- a/collapsibleTabs.js +++ b/collapsibleTabs.js @@ -193,34 +193,6 @@ } ) ); }, - /** - * Get the amount of horizontal distance between the two tabs groups in pixels. - * - * Uses `#left-navigation` and `#right-navigation`. If negative, this - * means that the tabs overlap, and the value is the width of overlapping - * parts. - * - * Used in default `expandCondition` and `collapseCondition` options. - * - * @return {number} distance/overlap in pixels - */ - calculateTabDistance: function () { - var leftTab, rightTab, leftEnd, rightStart; - - // In RTL, #right-navigation is actually on the left and vice versa. - // Hooray for descriptive naming. - if ( !isRTL ) { - leftTab = document.getElementById( 'left-navigation' ); - rightTab = document.getElementById( 'right-navigation' ); - } else { - leftTab = document.getElementById( 'right-navigation' ); - rightTab = document.getElementById( 'left-navigation' ); - } - - leftEnd = leftTab.getBoundingClientRect().right; - rightStart = rightTab.getBoundingClientRect().left; - return rightStart - leftEnd; - } }; /** diff --git a/jsduck.json b/jsduck.json index 53b2b9b..7f51d7a 100644 --- a/jsduck.json +++ b/jsduck.json @@ -5,6 +5,5 @@ "--warnings-exit-nonzero": true, "--warnings": ["-nodoc(class,public)"], "--": [ - "collapsibleTabs.js" ] } diff --git a/skin.json b/skin.json index 46a65e3..6a246a2 100644 --- a/skin.json +++ b/skin.json @@ -64,7 +64,6 @@ }, "skins.vector.js": { "scripts": [ - "collapsibleTabs.js", "vector.js" ], "dependencies": [ diff --git a/vector.js b/vector.js index 3b513f9..d58a0dd 100644 --- a/vector.js +++ b/vector.js @@ -66,29 +66,7 @@ jQuery( function ( $ ) { } }, collapseCondition: function () { - var collapsibleWidth = 0; - - // This looks a bit awkward because we're doing expensive queries as late - // as possible. - // TODO: The dropdown itself should probably "fold" to just the down-arrow - // (hiding the text) if it can't fit on the line? - - // Never collapse if there is no overlap. - if ( $.collapsibleTabs.calculateTabDistance() >= 0 ) { - return false; - } - - // Always collapse if the "More" button is already shown. - if ( !$cactions.hasClass( 'emptyPortlet' ) ) { - return true; - } - - $tabContainer.children( 'li.collapsible' ).each( function ( index, element ) { - collapsibleWidth += $( element ).width(); - // Stop this possibly expensive loop the moment the condition is met. - return !( collapsibleWidth > initialCactionsWidth() ); - } ); - return collapsibleWidth > initialCactionsWidth(); + return false; } } ); } );