CoreFiles by mySites.guru
keyboard-image-navigation.js21 lines, 497 bytes, from wordpress-4.6.21.zip
Raw History Compare with 4.6.20
md5
9ec09e3f667433fcc24b25abb4d91700
sha1
036ed656a319b649d3edd42b407e382ff7b87e9f
sha256
0330f4f446a7be3818e0246bee8b73b9b227c428c4f281ccd48f8aa9ef26dd77
/**
 * 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 215 releases, WordPress 4.2-beta1 to 4.6.30. See them all, or every version of this file.