mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-14 22:56:19 +01:00
Twenty Nineteen: Make sure links are followed on touchend, not touchstart.
The theme's original navigation JavaScript was making it so all links on a site were immediately followed on touchstart when using a touch-enabled device. This update makes sure links are followed at touchend, to improve usability and menu behavior. Props anevins, panchen, kjellr. Fixes #45510. Built from https://develop.svn.wordpress.org/branches/5.0@44357 git-svn-id: http://core.svn.wordpress.org/branches/5.0@44187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f2e2eac3bf
commit
b828ba64bb
@ -219,19 +219,9 @@
|
||||
|
||||
var url = event.target.getAttribute( 'href' ) ? event.target.getAttribute( 'href' ) : '';
|
||||
|
||||
// If there’s a link, go to it on touchend
|
||||
if ( '#' !== url && '' !== url ) {
|
||||
window.location = url;
|
||||
|
||||
// Open submenu if url is #
|
||||
} else if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) {
|
||||
|
||||
if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) {
|
||||
openSubMenu( event.target );
|
||||
|
||||
// Prevent default touch events
|
||||
} else {
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.0.3-alpha-44342';
|
||||
$wp_version = '5.0.3-alpha-44357';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user