mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Twenty Fourteen: fix an issue with keyboard navigation where you couldn't navigate to the previous image. Props obenland, see #25946.
git-svn-id: https://develop.svn.wordpress.org/trunk@26226 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
001e4b6052
commit
b52ee7959b
@ -1,12 +1,16 @@
|
||||
jQuery( document ).ready( function( $ ) {
|
||||
$( document ).keydown( function( e ) {
|
||||
jQuery( function( $ ) {
|
||||
$( document ).on( 'keydown.twentyfourteen', function( e ) {
|
||||
var url = false;
|
||||
if ( e.which === 37 ) { // Left arrow key code
|
||||
|
||||
// Left arrow key code.
|
||||
if ( e.which === 37 ) {
|
||||
url = $( '.previous-image a' ).attr( 'href' );
|
||||
}
|
||||
else if ( e.which === 39 ) { // Right arrow key code
|
||||
|
||||
// Right arrow key code.
|
||||
} else if ( e.which === 39 ) {
|
||||
url = $( '.entry-attachment a' ).attr( 'href' );
|
||||
}
|
||||
|
||||
if ( url && ( !$( 'textarea, input' ).is( ':focus' ) ) ) {
|
||||
window.location = url;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user