From 6c56ef0ffd7a55cdc9353cbc10df726dba459bab Mon Sep 17 00:00:00 2001 From: Kevin Vieira Date: Mon, 9 Dec 2024 12:06:18 -0500 Subject: [PATCH] making loading overlay absolute --- src/helpers/browser.ts | 18 +++++++++--------- src/helpers/exports-index.ts | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/helpers/browser.ts b/src/helpers/browser.ts index 0afec90..b39d3b9 100644 --- a/src/helpers/browser.ts +++ b/src/helpers/browser.ts @@ -1336,15 +1336,17 @@ export function loadModernFormsCSS() { document.head.appendChild(styleElm); } } -export function showLoadingOverlay(elm: HTMLElement, options?: { + +interface ILoadingOverlayOptions { bgColor?: string; - innerHtml?: string; -}) { - let overlay = elm.querySelector('.kw-loading-overlay') as HTMLDivElement; + innerHtml?: string; +} +export function showLoadingOverlay(elm: HTMLElement, options?: ILoadingOverlayOptions) { + let overlay = elm.querySelector('.kw-loading-overlay') as HTMLDivElement; if (!overlay) { overlay = document.createElement("div"); overlay.className = "kw-loading-overlay"; - overlay.style.position = "fixed"; + overlay.style.position = "absolute"; overlay.style.top = "0"; overlay.style.left = "0"; overlay.style.right = "0"; @@ -1354,6 +1356,7 @@ export function showLoadingOverlay(elm: HTMLElement, options?: { overlay.style.justifyContent = "center"; overlay.style.alignItems = "center"; overlay.style.height = "100%"; + overlay.style.width = "100%"; elm.appendChild(overlay); } overlay.innerHTML = options && options.innerHtml || ``; @@ -1365,10 +1368,7 @@ export function hideLoadingOverlay(elm: HTMLElement) { removeHTMLElement(overlays); } } -export function getLoadingOverlayHtml(options?: { - bgColor?: string; - innerHtml?: string; -}) { +export function getLoadingOverlayHtml(options?: ILoadingOverlayOptions) { let overlay = document.createElement("div"); showLoadingOverlay(overlay, options); return overlay.innerHTML; diff --git a/src/helpers/exports-index.ts b/src/helpers/exports-index.ts index fdb562b..37dd93b 100644 --- a/src/helpers/exports-index.ts +++ b/src/helpers/exports-index.ts @@ -10,6 +10,7 @@ export * from './color'; export * from './cookies'; export * from './date'; export * from './debug'; +export * from './diagrams'; export * from './emails'; export * from './eval'; export * from './file';