Changeset 29535
- Timestamp:
- 08/19/2014 03:26:14 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js
r29530 r29535 354 354 }); 355 355 356 // Excludes arrow keys, delete, backspace, enter, space bar. 357 function isSpecialKey( key ) { 358 return ( ( key <= 47 && key !== VK.SPACEBAR && key !== VK.ENTER && key !== VK.DELETE && key !== VK.BACKSPACE && ( key < 37 || key > 40 ) ) || 359 key === 144 || key === 145 || // Num Lock, Scroll Lock 360 ( key >= 91 && key <= 93 ) || // Windows keys 361 ( key >= 112 && key <= 123 ) ); // F keys 362 } 363 356 364 // (De)select views when arrow keys are used to navigate the content of the editor. 357 365 editor.on( 'keydown', function( event ) { … … 411 419 setViewCursor( false, view ); 412 420 } 421 413 422 event.preventDefault(); 414 423 // Ignore keys that don't insert anything. 415 } else if ( ( key > 47 || VK.SPACEBAR || key === VK.ENTER || key === VK.DELETE || key === VK.BACKSPACE ) && key !== 144 && key !== 145) {424 } else if ( ! isSpecialKey( key ) ) { 416 425 removeView( selected ); 417 426 … … 473 482 } 474 483 484 if ( isSpecialKey( key ) ) { 485 // ignore 486 return; 487 } 488 475 489 if ( ( cursorAfter && key === VK.UP ) || ( cursorBefore && key === VK.BACKSPACE ) ) { 476 490 if ( view.previousSibling ) {
Note: See TracChangeset
for help on using the changeset viewer.