Sha256: 25a8853aadee9d2b53a2ba8ba93a965407cdb18e34bdcd21353983ffc2172ad2

Contents?: true

Size: 487 Bytes

Versions: 3

Compression:

Stored size: 487 Bytes

Contents

/**
 * Twenty Fifteen keyboard support for image navigation.
 */

( function( $ ) {
	$( document ).on( 'keydown.twentyfifteen', function( e ) {
		var url = false;

		// Left arrow key code.
		if ( e.which === 37 ) {
			url = $( '.nav-previous a' ).attr( 'href' );

		// Right arrow key code.
		} else if ( e.which === 39 ) {
			url = $( '.nav-next 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/twentyfifteen/js/keyboard-image-navigation.js
boot-cli-0.3.1 lib/templates/wordpress/wp-content/themes/twentyfifteen/js/keyboard-image-navigation.js
boot-cli-0.3.0 lib/templates/wordpress/wp-content/themes/twentyfifteen/js/keyboard-image-navigation.js