From a089ad81acb2289929dcd106e3902f65ce6e1458 Mon Sep 17 00:00:00 2001 From: "David A. Kennedy" Date: Thu, 26 May 2016 17:47:24 -0400 Subject: [PATCH] Fix errors in Travis CI from latest PR. * `navigation.js` had a few spacing issues and variable placement problems causing JS Hint to throw errors. * See: https://github.com/Automattic/_s/pull/900 --- js/navigation.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/navigation.js b/js/navigation.js index aa961d61..62279943 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -82,17 +82,17 @@ /** * Toggles `focus` class to allow submenu access on tablets. */ - ( function ( container ) { - var touchStartFn, + ( function( container ) { + var touchStartFn, i, parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' ); if ( 'ontouchstart' in window ) { touchStartFn = function( e ) { - var menuItem = this.parentNode; + var menuItem = this.parentNode, i; if ( ! menuItem.classList.contains( 'focus' ) ) { e.preventDefault(); - for( var i = 0; i < menuItem.parentNode.children.length; ++i ) { + for ( i = 0; i < menuItem.parentNode.children.length; ++i ) { if ( menuItem === menuItem.parentNode.children[i] ) { continue; } @@ -104,9 +104,9 @@ } }; - for ( var i = 0; i < parentLink.length; ++i ) { + for ( i = 0; i < parentLink.length; ++i ) { parentLink[i].addEventListener( 'touchstart', touchStartFn, false ); } } - } ( container ) ); -} )(); + }( container ) ); +} )(); \ No newline at end of file