Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
API docs fixes. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Apr 24, 2017
1 parent 41cdd9c commit 6df1c21
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/model/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,11 @@ export default class Element extends Node {
}

/**
* Creates a copy of this element and returns it. Created element has same name and attributes as original element.
* If clone is not deep, children of copied element are references to the same nodes as in original element.
* If clone is deep, original element's children are also cloned.
* Creates a copy of this element and returns it. Created element has the same name and attributes as the original element.
* If clone is deep, the original element's children are also cloned. If not, then empty element is removed.
*
* @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
* element will be cloned without any children.
* element will be cloned without any child.
*/
clone( deep = false ) {
const children = deep ? Array.from( this._children ).map( ( node ) => node.clone( true ) ) : null;
Expand Down

0 comments on commit 6df1c21

Please sign in to comment.