2 * Vector-specific scripts
4 jQuery( function ( $ ) {
5 $( 'div.vectorMenu' ).each( function () {
7 $el
.find( '> h3 > a' ).parent()
8 .attr( 'tabindex', '0' )
9 // For accessibility, show the menu when the h3 is clicked (bug 24298/46486)
10 .on( 'click keypress', function ( e
) {
11 if ( e
.type
=== 'click' || e
.which
=== 13 ) {
12 $el
.toggleClass( 'menuForceShow' );
16 // When the heading has focus, also set a class that will change the arrow icon
18 $el
.find( '> a' ).addClass( 'vectorMenuFocus' );
21 $el
.find( '> a' ).removeClass( 'vectorMenuFocus' );
24 // As the h3 can already be focused there's no need for the link to be focusable
25 .attr( 'tabindex', '-1' );
31 $( '#mw-panel > .portal:first' ).addClass( 'first' );
34 * Collapsible tabs for Vector
36 var $cactions
= $( '#p-cactions' );
38 // Bind callback functions to animate our drop down menu in and out
39 // and then call the collapsibleTabs function on the menu
41 .bind( 'beforeTabCollapse', function () {
42 // If the dropdown was hidden, show it
43 if ( $cactions
.hasClass( 'emptyPortlet' ) ) {
45 .removeClass( 'emptyPortlet' )
47 .css( 'width', '1px' ).animate( { 'width': '24px' }, 390 );
50 .bind( 'beforeTabExpand', function () {
51 // If we're removing the last child node right now, hide the dropdown
52 if ( $cactions
.find( 'li' ).length
=== 1 ) {
53 $cactions
.find( 'h3' ).animate( { 'width': '1px' }, 390, function () {
54 $( this ).attr( 'style', '' )
55 .parent().addClass( 'emptyPortlet' );