Ticket #31527: 31527.patch
File 31527.patch, 1.3 KB (added by , 10 years ago) |
---|
-
wp-content/themes/twentyfifteen/js/functions.js
47 47 return; 48 48 } 49 49 50 // If the window resizes, add or remove ARIA attributes. 51 onResizeARIA = function() { 52 if ( 955 > $( window ).width() ) { 53 button.attr( 'aria-expanded', 'false' ); 54 secondary.attr( 'aria-expanded', 'false' ); 55 button.attr( 'aria-controls', 'secondary' ); 56 } else { 57 button.removeAttr( 'aria-expanded' ); 58 secondary.removeAttr( 'aria-expanded' ); 59 button.removeAttr( 'aria-controls' ); 60 } 61 } 62 63 // Fire the onResize function on resize and load. 64 $( window ).on( 'resize load', onResizeARIA ); 65 50 66 button.on( 'click.twentyfifteen', function() { 51 67 secondary.toggleClass( 'toggled-on' ); 52 68 secondary.trigger( 'resize' ); 53 69 $( this ).toggleClass( 'toggled-on' ); 70 if ( $( this, secondary ).hasClass( 'toggled-on' ) ) { 71 $( this ).attr( 'aria-expanded', 'true' ); 72 secondary.attr( 'aria-expanded', 'true' ); 73 } else { 74 $( this ).attr( 'aria-expanded', 'false' ); 75 secondary.attr( 'aria-expanded', 'false' ); 76 } 54 77 } ); 55 78 } )(); 56 79