Skip to content

Commit

Permalink
Fix errors in Travis CI from latest PR.
Browse files Browse the repository at this point in the history
* `navigation.js` had a few spacing issues and variable placement problems causing JS Hint to throw errors.
* See: Automattic/_s#900
  • Loading branch information
davidakennedy authored and MarkBatchelder committed Feb 18, 2018
1 parent 90d6fc0 commit 5ebabd0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions js/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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 ) );
} )();

0 comments on commit 5ebabd0

Please sign in to comment.