Browse Source

Simplified inserting the element.

Kamil Piechaczek 6 years ago
parent
commit
94b8c47910
1 changed files with 1 additions and 3 deletions
  1. 1 3
      packages/ckeditor5-horizontal-line/src/horizontalrulecommand.js

+ 1 - 3
packages/ckeditor5-horizontal-line/src/horizontalrulecommand.js

@@ -26,13 +26,11 @@ export default class HorizontalRuleCommand extends Command {
 	 */
 	execute() {
 		const model = this.editor.model;
-		const selection = model.document.selection;
 
 		model.change( writer => {
 			const modelElement = writer.createElement( 'horizontalRule' );
-			const insertPosition = findOptimalInsertionPosition( selection, model );
 
-			model.insertContent( modelElement, insertPosition );
+			model.insertContent( modelElement );
 			writer.setSelection( modelElement, 'on' );
 		} );
 	}