浏览代码

Simplified inserting the element.

Kamil Piechaczek 6 年之前
父节点
当前提交
94b8c47910
共有 1 个文件被更改,包括 1 次插入3 次删除
  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' );
 		} );
 	}