X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=skins%2Fvector%2Fvector.js;h=fb1f2123458bed813640cbb02d6b9baed125ce15;hb=a98cef2118b38384278d2d0d0ae8f0f11799be61;hp=8b719e5bc06dda4e200c3fac0e6f48a9fbaaa516;hpb=40f85ac347a6edf38b82896ebf97da4b786eb3a0;p=lhc%2Fweb%2Fwiklou.git diff --git a/skins/vector/vector.js b/skins/vector/vector.js index 8b719e5bc0..fb1f212345 100644 --- a/skins/vector/vector.js +++ b/skins/vector/vector.js @@ -4,7 +4,7 @@ jQuery( function ( $ ) { $( 'div.vectorMenu' ).each( function () { var $el = $( this ); - $el.find( 'h5:first a:first' ) + $el.find( 'h3:first a:first' ) // For accessibility, show the menu when the hidden link in the menu is clicked (bug 24298) .click( function ( e ) { $el.find( '.menu:first' ).toggleClass( 'menuForceShow' ); @@ -18,4 +18,32 @@ jQuery( function ( $ ) { $el.removeClass( 'vectorMenuFocus' ); } ); } ); + + /** + * Collapsible tabs for Vector + */ + var $cactions = $( '#p-cactions' ); + + // Bind callback functions to animate our drop down menu in and out + // and then call the collapsibleTabs function on the menu + $( '#p-views ul' ) + .bind( 'beforeTabCollapse', function () { + // If the dropdown was hidden, show it + if ( $cactions.hasClass( 'emptyPortlet' ) ) { + $cactions + .removeClass( 'emptyPortlet' ) + .find( 'h3, h5' ) + .css( 'width', '1px' ).animate( { 'width': '24px' }, 390 ); + } + } ) + .bind( 'beforeTabExpand', function () { + // If we're removing the last child node right now, hide the dropdown + if ( $cactions.find( 'li' ).length === 1 ) { + $cactions.find( 'h3, h5' ).animate( { 'width': '1px' }, 390, function () { + $( this ).attr( 'style', '' ) + .parent().addClass( 'emptyPortlet' ); + }); + } + } ) + .collapsibleTabs(); } );