mirror of
https://github.com/rio-labs/rio.git
synced 2026-05-05 19:00:14 -05:00
remove JS layouting
This commit is contained in:
committed by
Jakob Pinterits
parent
6e4975cce0
commit
fe5c5abfa6
+17
-1
@@ -101,6 +101,22 @@ export function firstDefined(...args: any[]): any {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/// Removes `oldElement` from the DOM and inserts `newElement` at its position
|
||||
export function replaceElement(oldElement: Element, newElement: Node): void {
|
||||
oldElement.parentElement?.insertBefore(newElement, oldElement);
|
||||
oldElement.remove();
|
||||
}
|
||||
|
||||
/// Wraps the given Element in a DIV
|
||||
export function insertWrapperElement(wrappedElement: Element): HTMLElement {
|
||||
let wrapperElement = document.createElement('div');
|
||||
|
||||
replaceElement(wrappedElement, wrapperElement);
|
||||
wrapperElement.appendChild(wrappedElement);
|
||||
|
||||
return wrapperElement;
|
||||
}
|
||||
|
||||
/// Adds a timeout to a promise. Throws TimeoutError if the time limit is
|
||||
/// exceeded before the promise resolves.
|
||||
export function timeout<T>(
|
||||
@@ -356,7 +372,7 @@ export async function getComponentLayouts(
|
||||
}
|
||||
|
||||
// And its parent
|
||||
let parentComponent = component.getParentExcludingInjected()!;
|
||||
let parentComponent = component.getParent()!;
|
||||
|
||||
if (parentComponent === null) {
|
||||
result.push(null);
|
||||
|
||||
Reference in New Issue
Block a user