public/code.js
/**
 * Mimics similar behaviour to ungrouping nodes in editor.
 * @param {SceneNode & ChildrenMixin } node A node with children
 * @param parent Target container to append ungrouped nodes to
 * @returns Selection of node's children
 */
Mimics similar behaviour to ungrouping nodes in editor.
@param {SceneNode & ChildrenMixin } node A node with children
@param parent Target container to append ungrouped nodes to
@returns Selection of node's children
Mimics similar behaviour to ungrouping nodes in editor . @param { SceneNode & ChildrenMixin } node A node with children @param parent Target container to append ungrouped nodes to @returns Selection of node ' s children
function ungroup(node, parent) {
    let selection = [];
    let children = node.children;
    for (let i = 0; i < children.length; i++) {
        parent.appendChild(children[i]);
        selection.push(children[i]);
    }
    if (node.type !== "GROUP") {
        node.remove();
    }
    return selection;
}
function ungroup ( node , parent ) { let selection = [ ] ; let children = node . children ; for ( let i = 0 ; i < children . length ; i ++ ) { parent . appendChild ( children [ i ] ) ; selection . push ( children [ i ] ) ; } if ( node . type !== "GROUP" ) { node . remove ( ) ; } return selection ; }
Mimics similar behaviour to ungrouping nodes in editor.
Mimics similar behaviour to ungrouping nodes in editor .
// Doesn't need removing if it's a group node