CoreFiles by mySites.guru
keyboard-image-navigation.js21 lines, 496 bytes, from wordpress-3.8.21.zip
Raw History Compare with 3.8.20
md5
0c6799a3dec7fed821b2da980f3a3a8b
sha1
e5ca0b4ab59d7cea1a11c2b65fd79c03e1eec61b
sha256
1790a3f16e08ea189e034d14cb168cb1da37c2a20d903361c7438d6dc13fbeb7
/**
 * 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 );

The same content is in 184 releases, WordPress 3.8-RC1 to 4.1.42. See them all, or every version of this file.