<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[39221] trunk/src/wp-content/themes/twentyseventeen/assets/js: Twenty Seventeen: Make sure theme JavaScript follows proper coding standards</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/39221">39221</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/39221","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>davidakennedy</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-11-14 11:40:55 +0000 (Mon, 14 Nov 2016)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Twenty Seventeen: Make sure theme JavaScript follows proper coding standards
Props sstoqnov, afercia.
Fixes <a href="https://core.trac.wordpress.org/ticket/38752">#38752</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpcontentthemestwentyseventeenassetsjscustomizecontrolsjs">trunk/src/wp-content/themes/twentyseventeen/assets/js/customize-controls.js</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeenassetsjscustomizepreviewjs">trunk/src/wp-content/themes/twentyseventeen/assets/js/customize-preview.js</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeenassetsjsglobaljs">trunk/src/wp-content/themes/twentyseventeen/assets/js/global.js</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeenassetsjsnavigationjs">trunk/src/wp-content/themes/twentyseventeen/assets/js/navigation.js</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeenassetsjsskiplinkfocusfixjs">trunk/src/wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpcontentthemestwentyseventeenassetsjscustomizecontrolsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/assets/js/customize-controls.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/assets/js/customize-controls.js 2016-11-14 11:22:25 UTC (rev 39220)
+++ trunk/src/wp-content/themes/twentyseventeen/assets/js/customize-controls.js 2016-11-14 11:40:55 UTC (rev 39221)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,7 +5,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * when users open or close the front page sections section.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp.customize.bind( 'ready', function() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Only show the color hue control when there's a custom color scheme.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,11 +24,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Detect when the front page sections section is expanded (or closed) so we can adjust the preview accordingly
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Detect when the front page sections section is expanded (or closed) so we can adjust the preview accordingly.
</ins><span class="cx" style="display: block; padding: 0 10px"> wp.customize.section( 'theme_options' ).expanded.bind( function( isExpanding ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Value of isExpanding will = true if you're entering the section, false if you're leaving it
- wp.customize.previewer.send( 'section-highlight', { expanded: isExpanding } );
- } );
- } );
-} )( jQuery );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Value of isExpanding will = true if you're entering the section, false if you're leaving it.
+ wp.customize.previewer.send( 'section-highlight', { expanded: isExpanding });
+ });
+ });
+})( jQuery );
</ins></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeenassetsjscustomizepreviewjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/assets/js/customize-preview.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/assets/js/customize-preview.js 2016-11-14 11:22:25 UTC (rev 39220)
+++ trunk/src/wp-content/themes/twentyseventeen/assets/js/customize-preview.js 2016-11-14 11:40:55 UTC (rev 39221)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,9 +4,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Instantly live-update customizer settings in the preview for improved user experience.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-( function( $ ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function( $ ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Collect information from customize-controls.js about which panels are opening
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Collect information from customize-controls.js about which panels are opening.
</ins><span class="cx" style="display: block; padding: 0 10px"> wp.customize.bind( 'preview-ready', function() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp.customize.preview.bind( 'section-highlight', function( data ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,75 +22,77 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $.scrollTo( $( '#panel1' ), {
</span><span class="cx" style="display: block; padding: 0 10px"> duration: 600,
</span><span class="cx" style="display: block; padding: 0 10px"> offset: { 'top': -70 } // Account for sticky menu.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If we've left the panel, hide the placeholders and scroll back to the top
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If we've left the panel, hide the placeholders and scroll back to the top.
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $( 'body' ).removeClass( 'highlight-front-sections' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( '.panel-placeholder' ).slideUp( 200 ); // Don't change scroll when leaving - it's likely to have unintended consequences.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Don't change scroll when leaving - it's likely to have unintended consequences.
+ $( '.panel-placeholder' ).slideUp( 200 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Site title and description.
</span><span class="cx" style="display: block; padding: 0 10px"> wp.customize( 'blogname', function( value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> value.bind( function( to ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.site-title a' ).text( to );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> wp.customize( 'blogdescription', function( value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> value.bind( function( to ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.site-description' ).text( to );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Header text color.
</span><span class="cx" style="display: block; padding: 0 10px"> wp.customize( 'header_textcolor', function( value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> value.bind( function( to ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'blank' === to ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( '.site-title, .site-description' ).css( {
- 'clip': 'rect(1px, 1px, 1px, 1px)',
- 'position': 'absolute'
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '.site-title, .site-description' ).css({
+ clip: 'rect(1px, 1px, 1px, 1px)',
+ position: 'absolute'
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> $( 'body' ).addClass( 'title-tagline-hidden' );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( '.site-title, .site-description' ).css( {
- 'clip': 'auto',
- 'position': 'relative'
- } );
- $( '.site-branding, .site-branding a, .site-description, .site-description a' ).css( {
- 'color': to
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '.site-title, .site-description' ).css({
+ clip: 'auto',
+ position: 'relative'
+ });
+ $( '.site-branding, .site-branding a, .site-description, .site-description a' ).css({
+ color: to
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> $( 'body' ).removeClass( 'title-tagline-hidden' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Color scheme.
</span><span class="cx" style="display: block; padding: 0 10px"> wp.customize( 'colorscheme', function( value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> value.bind( function( to ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update color body class.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( 'body' ).removeClass( 'colors-light colors-dark colors-custom' )
- .addClass( 'colors-' + to );
- } );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( 'body' )
+ .removeClass( 'colors-light colors-dark colors-custom' )
+ .addClass( 'colors-' + to );
+ });
+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Custom color hue.
</span><span class="cx" style="display: block; padding: 0 10px"> wp.customize( 'colorscheme_hue', function( value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> value.bind( function( to ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Update custom color CSS
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update custom color CSS.
</ins><span class="cx" style="display: block; padding: 0 10px"> var style = $( '#custom-theme-colors' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- hue = style.data( 'hue' ),
- css = style.html();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ hue = style.data( 'hue' ),
+ css = style.html();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- css = css.split( hue + ',' ).join( to + ',' ); // Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed.
- style.html( css )
- .data( 'hue', to );
- } );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed.
+ css = css.split( hue + ',' ).join( to + ',' );
+ style.html( css ).data( 'hue', to );
+ });
+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Page layouts.
</span><span class="cx" style="display: block; padding: 0 10px"> wp.customize( 'page_layout', function( value ) {
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeenassetsjsglobaljs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/assets/js/global.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/assets/js/global.js 2016-11-14 11:22:25 UTC (rev 39220)
+++ trunk/src/wp-content/themes/twentyseventeen/assets/js/global.js 2016-11-14 11:40:55 UTC (rev 39221)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,34 +1,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* global twentyseventeenScreenReaderText */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-( function( $ ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function( $ ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Variables and DOM Caching
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Variables and DOM Caching.
</ins><span class="cx" style="display: block; padding: 0 10px"> var $body = $( 'body' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $customHeader = $body.find( '.custom-header' ),
- $customHeaderImage = $customHeader.find( '.custom-header-image' ),
- $branding = $customHeader.find( '.site-branding' ),
- $navigation = $body.find( '.navigation-top' ),
- $navWrap = $navigation.find( '.wrap' ),
- $navMenuItem = $navigation.find( '.menu-item' ),
- $menuToggle = $navigation.find( '.menu-toggle' ),
- $menuScrollDown = $body.find( '.menu-scroll-down' ),
- $sidebar = $body.find( '#secondary' ),
- $entryContent = $body.find( '.entry-content' ),
- $formatQuote = $body.find( '.format-quote blockquote' ),
- isFrontPage = $body.hasClass( 'twentyseventeen-front-page' ) || $body.hasClass( 'home blog' ),
- navigationFixedClass = 'site-navigation-fixed',
- navigationHeight,
- navigationOuterHeight,
- navPadding,
- navMenuItemHeight,
- idealNavHeight,
- navIsNotTooTall,
- headerOffset,
- menuTop = 0,
- resizeTimer;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $customHeader = $body.find( '.custom-header' ),
+ $customHeaderImage = $customHeader.find( '.custom-header-image' ),
+ $branding = $customHeader.find( '.site-branding' ),
+ $navigation = $body.find( '.navigation-top' ),
+ $navWrap = $navigation.find( '.wrap' ),
+ $navMenuItem = $navigation.find( '.menu-item' ),
+ $menuToggle = $navigation.find( '.menu-toggle' ),
+ $menuScrollDown = $body.find( '.menu-scroll-down' ),
+ $sidebar = $body.find( '#secondary' ),
+ $entryContent = $body.find( '.entry-content' ),
+ $formatQuote = $body.find( '.format-quote blockquote' ),
+ isFrontPage = $body.hasClass( 'twentyseventeen-front-page' ) || $body.hasClass( 'home blog' ),
+ navigationFixedClass = 'site-navigation-fixed',
+ navigationHeight,
+ navigationOuterHeight,
+ navPadding,
+ navMenuItemHeight,
+ idealNavHeight,
+ navIsNotTooTall,
+ headerOffset,
+ menuTop = 0,
+ resizeTimer;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Ensure the sticky navigation doesn't cover current focused links
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Ensure the sticky navigation doesn't cover current focused links.
</ins><span class="cx" style="display: block; padding: 0 10px"> $( '#content a, #colophon a' ).focus( function() {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $navigation.hasClass( 'site-navigation-fixed' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var windowScrollTop = $( window ).scrollTop(),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,14 +40,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( offsetDiff < fixedNavHeight ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( window ).scrollTo( itemScrollTop - ( fixedNavHeight + 50 ), 600);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( window ).scrollTo( itemScrollTop - ( fixedNavHeight + 50 ), 600 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Sets properties of navigation
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Set properties of navigation.
</ins><span class="cx" style="display: block; padding: 0 10px"> function setNavProps() {
</span><span class="cx" style="display: block; padding: 0 10px"> navigationHeight = $navigation.height();
</span><span class="cx" style="display: block; padding: 0 10px"> navigationOuterHeight = $navigation.outerHeight();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,25 +55,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> navIsNotTooTall = navigationHeight <= idealNavHeight;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Makes navigation 'stick'
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Make navigation 'stick'.
</ins><span class="cx" style="display: block; padding: 0 10px"> function adjustScrollClass() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Make sure we're not on a mobile screen
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Make sure we're not on a mobile screen.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'none' === $menuToggle.css( 'display' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Make sure the nav isn't taller than two rows
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Make sure the nav isn't taller than two rows.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( navIsNotTooTall ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // When there's a custom header image, the header offset includes the height of the navigation
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // When there's a custom header image, the header offset includes the height of the navigation.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isFrontPage && $customHeaderImage.length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> headerOffset = $customHeader.innerHeight() - navigationOuterHeight;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> headerOffset = $customHeader.innerHeight();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If the scroll is more than the custom header, set the fixed class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If the scroll is more than the custom header, set the fixed class.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $( window ).scrollTop() >= headerOffset ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $navigation.addClass( navigationFixedClass );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,15 +80,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Remove 'fixed' class if nav is taller than two rows
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Remove 'fixed' class if nav is taller than two rows.
</ins><span class="cx" style="display: block; padding: 0 10px"> $navigation.removeClass( navigationFixedClass );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Sets margins of branding in header
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Set margins of branding in header.
</ins><span class="cx" style="display: block; padding: 0 10px"> function adjustHeaderHeight() {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'none' === $menuToggle.css( 'display' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,16 +103,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Sets icon for quotes
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Set icon for quotes.
</ins><span class="cx" style="display: block; padding: 0 10px"> function setQuotesIcon() {
</span><span class="cx" style="display: block; padding: 0 10px"> $( twentyseventeenScreenReaderText.quote ).prependTo( $formatQuote );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Add 'below-entry-meta' class to elements.
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Add 'below-entry-meta' class to elements.
</ins><span class="cx" style="display: block; padding: 0 10px"> function belowEntryMetaClass( param ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var sidebarPos, sidebarPosBottom;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,8 +126,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $entryContent.find( param ).each( function() {
</span><span class="cx" style="display: block; padding: 0 10px"> var $element = $( this ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- elementPos = $element.offset(),
- elementPosTop = elementPos.top;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ elementPos = $element.offset(),
+ elementPosTop = elementPos.top;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add 'below-entry-meta' to elements below the entry meta.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( elementPosTop > sidebarPosBottom ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +138,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
</ins><span class="cx" style="display: block; padding: 0 10px"> * Test if inline SVGs are supported.
</span><span class="cx" style="display: block; padding: 0 10px"> * @link https://github.com/Modernizr/Modernizr/
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,23 +148,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return 'http://www.w3.org/2000/svg' === ( 'undefined' !== typeof SVGRect && div.firstChild && div.firstChild.namespaceURI );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Fires on document ready
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Fire on document ready.
</ins><span class="cx" style="display: block; padding: 0 10px"> $( document ).ready( function() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If navigation menu is present on page, setNavProps and adjustScrollClass
- if( $navigation.length ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If navigation menu is present on page, setNavProps and adjustScrollClass.
+ if ( $navigation.length ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> setNavProps();
</span><span class="cx" style="display: block; padding: 0 10px"> adjustScrollClass();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If 'Scroll Down' arrow in present on page, calculate scroll offset and bind an event handler to the click event
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If 'Scroll Down' arrow in present on page, calculate scroll offset and bind an event handler to the click event.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $menuScrollDown.length ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $( 'body' ).hasClass( 'admin-bar' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> menuTop -= 32;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $( 'body' ).hasClass( 'blog' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- menuTop -= 30; // The div for latest posts has no space above content, add some to account for this
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ menuTop -= 30; // The div for latest posts has no space above content, add some to account for this.
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $navigation.length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> navigationOuterHeight = 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,9 +174,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> e.preventDefault();
</span><span class="cx" style="display: block; padding: 0 10px"> $( window ).scrollTo( '#primary', {
</span><span class="cx" style="display: block; padding: 0 10px"> duration: 600,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- offset: { 'top': menuTop - navigationOuterHeight }
- } );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ offset: { top: menuTop - navigationOuterHeight }
+ });
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> adjustHeaderHeight();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,22 +184,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( true === supportsInlineSVG() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> document.documentElement.className = document.documentElement.className.replace( /(\s*)no-svg(\s*)/, '$1svg$2' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If navigation menu is present on page, adjust it on scroll and screen resize
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If navigation menu is present on page, adjust it on scroll and screen resize.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $navigation.length ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // On scroll, we want to stick/unstick the navigation
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // On scroll, we want to stick/unstick the navigation.
</ins><span class="cx" style="display: block; padding: 0 10px"> $( window ).on( 'scroll', function() {
</span><span class="cx" style="display: block; padding: 0 10px"> adjustScrollClass();
</span><span class="cx" style="display: block; padding: 0 10px"> adjustHeaderHeight();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Also want to make sure the navigation is where it should be on resize
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Also want to make sure the navigation is where it should be on resize.
</ins><span class="cx" style="display: block; padding: 0 10px"> $( window ).resize( function() {
</span><span class="cx" style="display: block; padding: 0 10px"> setNavProps();
</span><span class="cx" style="display: block; padding: 0 10px"> setTimeout( adjustScrollClass, 500 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $( window ).resize( function() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,6 +208,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' );
</span><span class="cx" style="display: block; padding: 0 10px"> }, 300 );
</span><span class="cx" style="display: block; padding: 0 10px"> setTimeout( adjustHeaderHeight, 1000 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}( jQuery ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+})( jQuery );
</ins></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeenassetsjsnavigationjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/assets/js/navigation.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/assets/js/navigation.js 2016-11-14 11:22:25 UTC (rev 39220)
+++ trunk/src/wp-content/themes/twentyseventeen/assets/js/navigation.js 2016-11-14 11:40:55 UTC (rev 39221)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,20 +5,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Contains handlers for navigation and widget area.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-( function( $ ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function( $ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var masthead, menuToggle, siteNavigation;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function initMainNavigation( container ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add dropdown toggle that displays child menu items.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var dropdownToggle = $( '<button />', {
- 'class': 'dropdown-toggle',
- 'aria-expanded': false
- } ).append( twentyseventeenScreenReaderText.icon )
- .append( $( '<span />', {
- 'class': 'screen-reader-text',
- text: twentyseventeenScreenReaderText.expand
- } ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var dropdownToggle = $( '<button />', { 'class': 'dropdown-toggle', 'aria-expanded': false })
+ .append( twentyseventeenScreenReaderText.icon )
+ .append( $( '<span />', { 'class': 'screen-reader-text', text: twentyseventeenScreenReaderText.expand }) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> container.find( '.menu-item-has-children > a, .page_item_has_children > a' ).after( dropdownToggle );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,27 +25,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> container.find( '.menu-item-has-children, .page_item_has_children' ).attr( 'aria-haspopup', 'true' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> container.find( '.dropdown-toggle' ).click( function( e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var _this = $( this ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var _this = $( this ),
</ins><span class="cx" style="display: block; padding: 0 10px"> screenReaderSpan = _this.find( '.screen-reader-text' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> e.preventDefault();
</span><span class="cx" style="display: block; padding: 0 10px"> _this.toggleClass( 'toggled-on' );
</span><span class="cx" style="display: block; padding: 0 10px"> _this.next( '.children, .sub-menu' ).toggleClass( 'toggled-on' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // jscs:disable
</del><span class="cx" style="display: block; padding: 0 10px"> _this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // jscs:enable
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> screenReaderSpan.text( screenReaderSpan.text() === twentyseventeenScreenReaderText.expand ? twentyseventeenScreenReaderText.collapse : twentyseventeenScreenReaderText.expand );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> initMainNavigation( $( '.main-navigation' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- masthead = $( '#masthead' );
- menuToggle = masthead.find( '.menu-toggle' );
- siteNavigation = masthead.find( '.main-navigation > div > ul' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ masthead = $( '#masthead' );
+ menuToggle = masthead.find( '.menu-toggle' );
+ siteNavigation = masthead.find( '.main-navigation > div > ul' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Enable menuToggle.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ (function() {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Return early if menuToggle is missing.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! menuToggle.length ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,14 +58,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> menuToggle.on( 'click.twentyseventeen', function() {
</span><span class="cx" style="display: block; padding: 0 10px"> $( siteNavigation.closest( '.main-navigation' ), this ).toggleClass( 'toggled-on' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // jscs:disable
- $( this ).add( siteNavigation ).attr( 'aria-expanded', $( this ).add( siteNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
- // jscs:enable
- } );
- } )();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( this )
+ .add( siteNavigation )
+ .attr( 'aria-expanded', $( this ).add( siteNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
+ });
+ })();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ (function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! siteNavigation.length || ! siteNavigation.children().length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,17 +78,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $( e.target ).closest( '.main-navigation li' ).length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.main-navigation li' ).removeClass( 'focus' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- siteNavigation.find( '.menu-item-has-children > a, .page_item_has_children > a' ).on( 'touchstart.twentyseventeen', function( e ) {
- var el = $( this ).parent( 'li' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ siteNavigation.find( '.menu-item-has-children > a, .page_item_has_children > a' )
+ .on( 'touchstart.twentyseventeen', function( e ) {
+ var el = $( this ).parent( 'li' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! el.hasClass( 'focus' ) ) {
- e.preventDefault();
- el.toggleClass( 'focus' );
- el.siblings( '.focus' ).removeClass( 'focus' );
- }
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! el.hasClass( 'focus' ) ) {
+ e.preventDefault();
+ el.toggleClass( 'focus' );
+ el.siblings( '.focus' ).removeClass( 'focus' );
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> siteNavigation.find( '.menu-item-has-children > a, .page_item_has_children > a' ).unbind( 'touchstart.twentyseventeen' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,8 +103,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> siteNavigation.find( 'a' ).on( 'focus.twentyseventeen blur.twentyseventeen', function() {
</span><span class="cx" style="display: block; padding: 0 10px"> $( this ).parents( '.menu-item, .page_item' ).toggleClass( 'focus' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
- } )();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ })();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add the default ARIA attributes for the menu toggle and the navigations.
</span><span class="cx" style="display: block; padding: 0 10px"> function onResizeARIA() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,6 +131,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $( document ).ready( function() {
</span><span class="cx" style="display: block; padding: 0 10px"> $( window ).on( 'load.twentyseventeen', onResizeARIA );
</span><span class="cx" style="display: block; padding: 0 10px"> $( window ).on( 'resize.twentyseventeen', onResizeARIA );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-} )( jQuery );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+})( jQuery );
</ins></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeenassetsjsskiplinkfocusfixjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js 2016-11-14 11:22:25 UTC (rev 39220)
+++ trunk/src/wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js 2016-11-14 11:40:55 UTC (rev 39221)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,7 +5,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Learn more: https://git.io/vWdr2
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> var isIe = /(trident|msie)/i.test( navigator.userAgent );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isIe && document.getElementById && window.addEventListener ) {
</span></span></pre>
</div>
</div>
</body>
</html>