MCPcopy Index your code
hub / github.com/tinymce/tinymce / empty

Method empty

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

* Removes all children of the current node. * * @method empty * @return {tinymce.html.Node} The current node that got cleared.

()

Source from the content-addressed store, hash-verified

466 * @return {tinymce.html.Node} The current node that got cleared.
467 */
468 public empty(): AstNode {
469 const self = this;
470
471 // Remove all children
472 if (self.firstChild) {
473 const nodes = [];
474
475 // Collect the children
476 for (let node: AstNode | null | undefined = self.firstChild; node; node = walk(node, self)) {
477 nodes.push(node);
478 }
479
480 // Remove the children
481 let i = nodes.length;
482 while (i--) {
483 const node = nodes[i];
484 node.parent = node.firstChild = node.lastChild = node.next = node.prev = null;
485 }
486 }
487
488 self.firstChild = self.lastChild = null;
489
490 return self;
491 }
492
493 /**
494 * Returns true/false if the node is to be considered empty or not.

Callers 15

generateSectionFunction · 0.80
syncRowsFunction · 0.80
mergeFunction · 0.80
testFragmentedTextFunction · 0.80
NodeTest.tsFile · 0.80
setupOffscreenSelectionFunction · 0.80
fillWithPaddingBrFunction · 0.80
sidelongBlockMergeFunction · 0.80
paddEmptyBlockFunction · 0.80
cleanInvalidNodesFunction · 0.80
processNodeFunction · 0.80

Calls 1

walkFunction · 0.70

Tested by

no test coverage detected