Explorar o código

Docs: Added more explanation.

Szymon Cofalik %!s(int64=7) %!d(string=hai) anos
pai
achega
9060ebf790
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      packages/ckeditor5-engine/src/model/writer.js

+ 3 - 0
packages/ckeditor5-engine/src/model/writer.js

@@ -176,8 +176,11 @@ export default class Writer {
 			// If it isn't the same root.
 			else {
 				if ( item.root.document ) {
+					// It is forbidden to move a node that was already in a document outside of it.
 					throw new Error( 'model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree.' );
 				} else {
+					// Move between two different document fragments or from document fragment to a document is possible.
+					// In that case, remove the item from it's original parent.
 					this.remove( item );
 				}
 			}