| 428 | |
| 429 | editor.on( 'key', function( evt ) |
| 430 | { |
| 431 | // Backspace at the beginning of list item should outdent it. |
| 432 | if ( editor.mode == 'wysiwyg' && evt.data.keyCode == 8 ) |
| 433 | { |
| 434 | var sel = editor.getSelection(), |
| 435 | start = sel.getStartElement(), |
| 436 | path = new CKEDITOR.dom.elementPath( start ), |
| 437 | block = path.block; |
| 438 | |
| 439 | if ( block && ( block.is( 'li' ) || block.getParent().is( 'li' ) ) ) |
| 440 | { |
| 441 | var range = sel.getRanges()[ 0 ]; |
| 442 | if ( range.checkStartOfBlock() ) |
| 443 | { |
| 444 | editor.execCommand( 'outdent' ); |
| 445 | evt.cancel(); |
| 446 | } |
| 447 | } |
| 448 | } |
| 449 | }); |