Permalink
Browse files

Fix mobile nav not getting focus on first click

  • Loading branch information...
ronilaukkarinen committed Apr 27, 2018
1 parent c44dcb0 commit e358f0f2f385f8542c61656d1017afcf70fb4198
Showing with 5 additions and 36 deletions.
  1. +1 −1 functions.php
  2. +1 −1 js/all.js
  3. +0 −31 js/src/navigation.js
  4. +1 −1 package.json
  5. +1 −1 readme.txt
  6. +1 −1 style.css
View
@@ -5,7 +5,7 @@
* @package air-light
*/
define( 'AIR_LIGHT_VERSION', '4.0.9' );
define( 'AIR_LIGHT_VERSION', '4.1.0' );
/**
* Requires.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -294,35 +294,4 @@ https://github.com/wpaccessibility/a11ythemepatterns/tree/master/menu-keyboard-a
}
}
/**
* Toggles `focus` class to allow submenu access on tablets.
*/
( 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, i;
if ( ! menuItem.classList.contains( 'focus' ) ) {
e.preventDefault();
for ( i = 0; i < menuItem.parentNode.children.length; ++i ) {
if ( menuItem === menuItem.parentNode.children[i] ) {
continue;
}
menuItem.parentNode.children[i].classList.remove( 'focus' );
}
menuItem.classList.add( 'focus' );
} else {
menuItem.classList.remove( 'focus' );
}
};
for ( i = 0; i < parentLink.length; ++i ) {
parentLink[i].addEventListener( 'touchstart', touchStartFn, false );
}
}
}( container ) );
})(jQuery);
View
@@ -1,6 +1,6 @@
{
"name": "air-light",
"version": "4.0.9",
"version": "4.1.0",
"description": "A minimalist WordPress starter theme.",
"author": "Digitoimisto Dude Oy (moro@dude.fi)",
"devDependencies": {
View
@@ -12,7 +12,7 @@ Tags: one-column, accessibility-ready, translation-ready
Requires at least: 4.0
Tested up to: 4.9.3
Stable tag: 4.0.7
Stable tag: 4.1.0
License: MIT License
License URI: https://opensource.org/licenses/MIT
View
@@ -4,7 +4,7 @@ Theme URI: https://github.com/digitoimistodude/air-light
Author: Digitoimisto Dude Oy
Author URI: https://www.dude.fi
Description: A minimalist WordPress starter theme.
Version: 4.0.9
Version: 4.1.0
License: MIT License
License URI: https://github.com/digitoimistodude/air-light/blob/master/LICENSE.md
Text Domain: air-light

0 comments on commit e358f0f

Please sign in to comment.