MCPcopy
hub / github.com/tinymce/tinymce / append

Method append

modules/tinymce/src/core/main/ts/api/html/Node.ts:358–377  ·  view source on GitHub ↗

* Appends a new node as a child of the current node. * * @method append * @param {tinymce.html.Node} node Node to append as a child of the current one. * @return {tinymce.html.Node} The node that got appended. * @example * node.append(someNode);

(node: AstNode)

Source from the content-addressed store, hash-verified

356 * node.append(someNode);
357 */
358 public append(node: AstNode): AstNode {
359 const self = this;
360
361 if (node.parent) {
362 node.remove();
363 }
364
365 const last = self.lastChild;
366 if (last) {
367 last.next = node;
368 node.prev = last;
369 self.lastChild = node;
370 } else {
371 self.lastChild = self.firstChild = node;
372 }
373
374 node.parent = self;
375
376 return node;
377 }
378
379 /**
380 * Inserts a node at a specific position as a child of this node.

Callers 15

getFontTreeFunction · 0.95
transferChildrenFunction · 0.95
createPreviewNodeFunction · 0.95
generateWFunction · 0.80
generateHFunction · 0.80
checkWidthFunction · 0.80
checkRowHeightFunction · 0.80
checkFunction · 0.80
TableSizeTest.tsFile · 0.80

Calls 1

removeMethod · 0.65

Tested by

no test coverage detected