17 | | editor.insertElement( editor.document.createElement( 'hr' ) ); |
| 17 | var hr = editor.document.createElement( 'hr' ), |
| 18 | range = new CKEDITOR.dom.range( editor.document ); |
| 19 | |
| 20 | editor.insertElement( hr ); |
| 21 | |
| 22 | // If there's nothing or a non-editable block followed by, establish a new paragraph |
| 23 | // to make sure cursor is not trapped. |
| 24 | range.moveToPosition( hr, CKEDITOR.POSITION_AFTER_END ); |
| 25 | var next = hr.getNext(); |
| 26 | if ( !next || next.type == CKEDITOR.NODE_ELEMENT && !next.isEditable() ) |
| 27 | range.fixBlock( true, editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' ); |
| 28 | |
| 29 | range.select(); |