Browse Source

Docs: Improved docs.

Oskar Wróbel 8 years ago
parent
commit
97eb691f6c

+ 3 - 5
packages/ckeditor5-engine/src/controller/editingcontroller.js

@@ -32,10 +32,6 @@ import mix from '@ckeditor/ckeditor5-utils/src/mix';
  * including selection handling. It also creates {@link ~EditingController#view view document} which build a
  * browser-independent virtualization over the DOM elements. Editing controller also attach default converters.
  *
- * Editing controller binds {@link module:engine/view/document~Document#roots view roots collection} to
- * {@link module:engine/model/document~Document#roots model roots collection} so creating model root automatically
- * creates corresponding view root.
- *
  * @mixes module:utils/observablemixin~ObservableMixin
  */
 export default class EditingController {
@@ -147,7 +143,9 @@ export default class EditingController {
 		this.modelToView.on( 'selection', convertRangeSelection(), { priority: 'low' } );
 		this.modelToView.on( 'selection', convertCollapsedSelection(), { priority: 'low' } );
 
-		// Bind model and view roots.
+		// Binds {@link module:engine/view/document~Document#roots view roots collection} to
+		// {@link module:engine/model/document~Document#roots model roots collection} so creating
+		// model root automatically creates corresponding view root.
 		this.view.roots.bindTo( this.model.document.roots ).using( root => {
 			// $graveyard is a special root that has no reflection in the view.
 			if ( root.rootName == '$graveyard' ) {

+ 0 - 4
packages/ckeditor5-engine/src/model/document.js

@@ -149,10 +149,6 @@ export default class Document {
 	/**
 	 * Creates a new top-level root.
 	 *
-	 * **Note**: Creating model root automatically creates corresponding
-	 * {@link module:engine/view/document~Document#roots view root} with the same name. Name of view root
-	 * will be hanged later on when dom root will be {@link module:engine/view/document~Document#attachDomRoot attached}.
-	 *
 	 * @param {String} [elementName='$root'] Element name. Defaults to `'$root'` which also have
 	 * some basic schema defined (`$block`s are allowed inside the `$root`). Make sure to define a proper
 	 * schema if you use a different name.

+ 3 - 2
packages/ckeditor5-engine/src/view/rooteditableelement.js

@@ -58,8 +58,9 @@ export default class RootEditableElement extends EditableElement {
 
 	/**
 	 * Overrides old element name and sets new one.
-	 * This is needed because name of view root has to be changed as the same as dom root name
-	 * when dom root is attached to view root.
+	 * This is needed because view roots are created before they are attached to the DOM.
+	 * The name of the root element is temporary at this stage. It has to be changed when the
+	 * view root element is attached to the DOM element.
 	 *
 	 * @protected
 	 * @param {String} name The new name of element.