Ticket #38752: 38752.diff
File 38752.diff, 4.6 KB (added by , 8 years ago) |
---|
-
src/wp-content/themes/twentyseventeen/assets/js/customize-preview.js
59 59 'clip': 'auto', 60 60 'position': 'relative' 61 61 } ); 62 $( '.site-branding, .site-branding a, .site-description, .site-description a' ).css( { 63 'color': to 64 } ); 62 $( '.site-branding, .site-branding a, .site-description, .site-description a' ) 63 .css( { 64 'color': to 65 } ); 65 66 $( 'body' ).removeClass( 'title-tagline-hidden' ); 66 67 } 67 68 } ); … … 72 73 value.bind( function( to ) { 73 74 74 75 // Update color body class. 75 $( 'body' ).removeClass( 'colors-light colors-dark colors-custom' ) 76 .addClass( 'colors-' + to ); 76 $( 'body' ) 77 .removeClass( 'colors-light colors-dark colors-custom' ) 78 .addClass( 'colors-' + to ); 77 79 } ); 78 80 } ); 79 81 … … 83 85 84 86 // Update custom color CSS 85 87 var style = $( '#custom-theme-colors' ), 86 87 88 hue = style.data( 'hue' ), 89 css = style.html(); 88 90 89 91 css = css.split( hue + ',' ).join( to + ',' ); // Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed. 90 style.html( css ) 91 .data( 'hue', to ); 92 style.html( css ).data( 'hue', to ); 92 93 } ); 93 94 } ); 94 95 -
src/wp-content/themes/twentyseventeen/assets/js/global.js
164 164 $( document ).ready( function() { 165 165 166 166 // If navigation menu is present on page, setNavProps and adjustScrollClass 167 if ( $navigation.length ) {167 if ( $navigation.length ) { 168 168 setNavProps(); 169 169 adjustScrollClass(); 170 170 } -
src/wp-content/themes/twentyseventeen/assets/js/navigation.js
14 14 var dropdownToggle = $( '<button />', { 15 15 'class': 'dropdown-toggle', 16 16 'aria-expanded': false 17 } ).append( twentyseventeenScreenReaderText.icon ) 18 .append( $( '<span />', { 19 'class': 'screen-reader-text', 20 text: twentyseventeenScreenReaderText.expand 21 } ) ); 17 } ) 18 .append( twentyseventeenScreenReaderText.icon ) 19 .append( $( '<span />', { 20 'class': 'screen-reader-text', 21 text: twentyseventeenScreenReaderText.expand 22 } ) ); 22 23 23 24 container.find( '.menu-item-has-children > a, .page_item_has_children > a' ).after( dropdownToggle ); 24 25 … … 30 31 container.find( '.menu-item-has-children, .page_item_has_children' ).attr( 'aria-haspopup', 'true' ); 31 32 32 33 container.find( '.dropdown-toggle' ).click( function( e ) { 33 var _this = $( this ), 34 screenReaderSpan = _this.find( '.screen-reader-text' ); 34 var _this = $( this ), 35 screenReaderSpan = _this.find( '.screen-reader-text' ), 36 screenReaderSpanText; 35 37 36 38 e.preventDefault(); 37 39 _this.toggleClass( 'toggled-on' ); 38 40 _this.next( '.children, .sub-menu' ).toggleClass( 'toggled-on' ); 39 41 40 // jscs:disable41 42 _this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' ); 42 // jscs:enable 43 screenReaderSpan.text( screenReaderSpan.text() === twentyseventeenScreenReaderText.expand ? twentyseventeenScreenReaderText.collapse : twentyseventeenScreenReaderText.expand ); 43 44 if ( screenReaderSpan.text() === twentyseventeenScreenReaderText.expand ) { 45 screenReaderSpanText = twentyseventeenScreenReaderText.collapse; 46 } else { 47 screenReaderSpanText = twentyseventeenScreenReaderText.expand 48 } 49 50 screenReaderSpan.text( screenReaderSpanText ); 44 51 } ); 45 52 } 46 53 initMainNavigation( $( '.main-navigation' ) ); … … 63 70 menuToggle.on( 'click.twentyseventeen', function() { 64 71 $( siteNavigation.closest( '.main-navigation' ), this ).toggleClass( 'toggled-on' ); 65 72 66 // jscs:disable67 $( this ).add( siteNavigation ).attr( 'aria-expanded', $( this ).add( siteNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );68 // jscs:enable73 $( this ) 74 .add( siteNavigation ) 75 .attr( 'aria-expanded', $( this ).add( siteNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' ); 69 76 } ); 70 77 } )();