Ver Fonte

Removed model from DocumentSelection params.

Oskar Wróbel há 8 anos atrás
pai
commit
e987e385d8

+ 1 - 1
packages/ckeditor5-engine/src/model/document.js

@@ -74,7 +74,7 @@ export default class Document {
 		 * @readonly
 		 * @member {module:engine/model/documentselection~DocumentSelection}
 		 */
-		this.selection = new DocumentSelection( this, this.model );
+		this.selection = new DocumentSelection( this );
 
 		/**
 		 * List of roots that are owned and managed by this document. Use {@link #createRoot} and

+ 2 - 3
packages/ckeditor5-engine/src/model/documentselection.js

@@ -52,9 +52,8 @@ export default class DocumentSelection extends Selection {
 	 * Creates an empty live selection for given {@link module:engine/model/document~Document}.
 	 *
 	 * @param {module:engine/model/document~Document} document Document which owns this selection.
-	 * @param {module:engine/model/model~Model} model Data model.
 	 */
-	constructor( document, model ) {
+	constructor( document ) {
 		super();
 
 		/**
@@ -63,7 +62,7 @@ export default class DocumentSelection extends Selection {
 		 * @protected
 		 * @member {module:engine/model/model~Model}
 		 */
-		this._model = model;
+		this._model = document.model;
 
 		/**
 		 * Document which owns this selection.