forked from mirror/_s
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
This commit is contained in:
parent
ad8a7c0ac7
commit
a089ad81ac
|
@ -82,17 +82,17 @@
|
||||||
/**
|
/**
|
||||||
* Toggles `focus` class to allow submenu access on tablets.
|
* Toggles `focus` class to allow submenu access on tablets.
|
||||||
*/
|
*/
|
||||||
( function ( container ) {
|
( function( container ) {
|
||||||
var touchStartFn,
|
var touchStartFn, i,
|
||||||
parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );
|
parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );
|
||||||
|
|
||||||
if ( 'ontouchstart' in window ) {
|
if ( 'ontouchstart' in window ) {
|
||||||
touchStartFn = function( e ) {
|
touchStartFn = function( e ) {
|
||||||
var menuItem = this.parentNode;
|
var menuItem = this.parentNode, i;
|
||||||
|
|
||||||
if ( ! menuItem.classList.contains( 'focus' ) ) {
|
if ( ! menuItem.classList.contains( 'focus' ) ) {
|
||||||
e.preventDefault();
|
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] ) {
|
if ( menuItem === menuItem.parentNode.children[i] ) {
|
||||||
continue;
|
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 );
|
parentLink[i].addEventListener( 'touchstart', touchStartFn, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} ( container ) );
|
}( container ) );
|
||||||
} )();
|
} )();
|
Reference in New Issue