diff --git a/src/wp-includes/js/wplink.js b/src/wp-includes/js/wplink.js index f34a9bea09..b5a84aecb7 100644 --- a/src/wp-includes/js/wplink.js +++ b/src/wp-includes/js/wplink.js @@ -459,13 +459,14 @@ var wpLink; }, keydown: function( event ) { - var fn, id, - key = $.ui.keyCode; + var fn, id; - if ( key.ESCAPE === event.keyCode ) { + // Escape key. + if ( 27 === event.keyCode ) { wpLink.close(); event.stopImmediatePropagation(); - } else if ( key.TAB === event.keyCode ) { + // Tab key. + } else if ( 9 === event.keyCode ) { id = event.target.id; // wp-link-submit must always be the last focusable element in the dialog. @@ -479,7 +480,8 @@ var wpLink; } } - if ( event.keyCode !== key.UP && event.keyCode !== key.DOWN ) { + // Up Arrow and Down Arrow keys. + if ( 38 !== event.keyCode && 40 !== event.keyCode ) { return; } @@ -488,7 +490,8 @@ var wpLink; return; } - fn = event.keyCode === key.UP ? 'prev' : 'next'; + // Up Arrow key. + fn = 38 === event.keyCode ? 'prev' : 'next'; clearInterval( wpLink.keyInterval ); wpLink[ fn ](); wpLink.keyInterval = setInterval( wpLink[ fn ], wpLink.keySensitivity ); @@ -496,9 +499,8 @@ var wpLink; }, keyup: function( event ) { - var key = $.ui.keyCode; - - if ( event.which === key.UP || event.which === key.DOWN ) { + // Up Arrow and Down Arrow keys. + if ( 38 === event.keyCode || 40 === event.keyCode ) { clearInterval( wpLink.keyInterval ); event.preventDefault(); }