Sha256: 0330f4f446a7be3818e0246bee8b73b9b227c428c4f281ccd48f8aa9ef26dd77

Contents?: true

Size: 497 Bytes

Versions: 3

Compression:

Stored size: 497 Bytes

Contents

/**
 * 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 );

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
boot-cli-1.0.0 lib/templates/wordpress/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js
boot-cli-0.3.1 lib/templates/wordpress/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js
boot-cli-0.3.0 lib/templates/wordpress/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js