MCPcopy
hub / github.com/RaspberryPiFoundation/blockly / allFieldsToDom

Function allFieldsToDom

packages/blockly/core/xml.ts:168–175  ·  view source on GitHub ↗

* Encode all of a block's fields as XML and attach them to the given tree of * XML elements. * * @param block A block with fields to be encoded. * @param element The XML element to which the field DOM should be attached.

(block: Block, element: Element)

Source from the content-addressed store, hash-verified

166 * @param element The XML element to which the field DOM should be attached.
167 */
168function allFieldsToDom(block: Block, element: Element) {
169 for (const field of block.getFields()) {
170 const fieldDom = fieldToDom(field);
171 if (fieldDom) {
172 element.appendChild(fieldDom);
173 }
174 }
175}
176
177/**
178 * Encode a block subtree as XML.

Callers 1

blockToDomFunction · 0.85

Calls 2

fieldToDomFunction · 0.85
getFieldsMethod · 0.80

Tested by

no test coverage detected