mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-19 09:05:22 +01:00
17f69a89d4
Built from https://develop.svn.wordpress.org/trunk@31250 git-svn-id: http://core.svn.wordpress.org/trunk@31231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
21 lines
497 B
JavaScript
21 lines
497 B
JavaScript
/**
|
|
* Twenty Fourteen keyboard support for image navigation.
|
|
*/
|
|
( function( $ ) {
|
|
$( document ).on( 'keydown.twentyfourteen', function( e ) {
|
|
var url = false;
|
|
|
|
// Left arrow key code.
|
|
if ( e.which === 37 ) {
|
|
url = $( '.previous-image a' ).attr( 'href' );
|
|
|
|
// Right arrow key code.
|
|
} else if ( e.which === 39 ) {
|
|
url = $( '.entry-attachment a' ).attr( 'href' );
|
|
}
|
|
|
|
if ( url && ( ! $( 'textarea, input' ).is( ':focus' ) ) ) {
|
|
window.location = url;
|
|
}
|
|
} );
|
|
} )( jQuery ); |