mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-18 16:45:31 +01:00
433c648e1d
Built from https://develop.svn.wordpress.org/trunk@26226 git-svn-id: http://core.svn.wordpress.org/trunk@26133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
18 lines
426 B
JavaScript
18 lines
426 B
JavaScript
jQuery( 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;
|
|
}
|
|
} );
|
|
} ); |