mirror of https://github.com/Budibase/budibase.git
1 changed files with 0 additions and 14 deletions
@ -1,14 +0,0 @@ |
|||||
export function portal(node, targetNodeOrSelector) { |
|
||||
const targetNode = |
|
||||
typeof targetNodeOrSelector == "string" |
|
||||
? document.querySelector(targetNodeOrSelector) |
|
||||
: targetNodeOrSelector |
|
||||
const portalChildren = [...node.children] |
|
||||
targetNode.append(...portalChildren) |
|
||||
|
|
||||
return { |
|
||||
destroy() { |
|
||||
for (const portalChild of portalChildren) portalChild.remove() |
|
||||
}, |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue