346 | | // Let key presses that involve the command or control keys through. |
347 | | // Also, let any of the F# keys through. |
348 | | if ( event.metaKey || event.ctrlKey || ( key >= 112 && key <= 123 ) ) { |
349 | | // But remove the view when cmd/ctrl + x/backspace are pressed. |
350 | | if ( ( event.metaKey || event.ctrlKey ) && ( key === 88 || key === VK.BACKSPACE ) ) { |
351 | | // We'll remove a cut view on keyup, otherwise the browser can't copy the content. |
352 | | if ( key === 88 ) { |
353 | | toRemove = selected; |
354 | | } else { |
355 | | editor.dom.remove( selected ); |
356 | | } |
| 346 | // Ignore key presses that involve the command or control key, but continue when in combination with backspace or v. |
| 347 | // Also ignore the F# keys. |
| 348 | if ( ( ( event.metaKey || event.ctrlKey ) && key !== VK.BACKSPACE && key !== 86 ) || ( key >= 112 && key <= 123 ) ) { |
| 349 | // Remove the view when pressing cmd/ctrl+x on keyup, otherwise the browser can't copy the content. |
| 350 | if ( ( event.metaKey || event.ctrlKey ) && key === 88 ) { |
| 351 | toRemove = selected; |
440 | | // Make sure we don't eat any content. |
441 | | if ( event.keyCode === VK.BACKSPACE ) { |
442 | | if ( editor.dom.isEmpty( node ) ) { |
443 | | if ( view = getView( node.previousSibling ) ) { |
| 435 | if ( ! view ) { |
| 436 | // Make sure we don't eat any content. |
| 437 | if ( event.keyCode === VK.BACKSPACE ) { |
| 438 | if ( editor.dom.isEmpty( node ) ) { |
| 439 | if ( view = getView( node.previousSibling ) ) { |
| 440 | setViewCursor( false, view ); |
| 441 | editor.dom.remove( node ); |
| 442 | event.preventDefault(); |
| 443 | } |
| 444 | } else if ( ( range = selection.getRng() ) && |
| 445 | range.startOffset === 0 && |
| 446 | range.endOffset === 0 && |
| 447 | ( view = getView( node.previousSibling ) ) ) { |