Fix toast notification positioning for WHM iframe

Use inline fixed positioning instead of DaisyUI toast classes which
don't work correctly inside WHM's iframe structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shuki
2026-03-04 02:59:41 +02:00
parent eb93333b9f
commit df6753ad78
4 changed files with 6 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
<!-- Tailwind/DaisyUI class safelist for gniza WHM plugin --> <!-- Tailwind/DaisyUI class safelist for gniza WHM plugin -->
<div class="alert alert-error alert-info alert-success alert-warning badge badge-error badge-sm badge-success badge-warning bg-base-100 bg-base-200 bg-neutral bg-primary/10 border border-base-300 border-base-content/5 breadcrumbs btn btn-error btn-ghost btn-primary btn-secondary btn-sm btn-xs card card-body card-title checkbox checkbox-sm cursor-pointer flex flex-1 flex-col flex-wrap font-bold font-medium font-mono font-semibold gap-1 gap-2 gap-3 hidden inline input input-bordered input-sm items-center items-start mx-auto join join-item link list-disc loading loading-spinner loading-xs max-h-48 max-w-2xl max-w-xs mb-1 mb-2.5 mb-3 mb-4 mb-5 mb-6 ml-2 modal modal-action modal-backdrop modal-box mt-2 mt-3 mt-4 mt-5 my-2 my-4 overflow-x-auto overflow-y-auto p-3 p-4 pt-1 pt-2 pl-5 px-4 py-1 py-3 py-4 radio radio-sm rounded-box rounded-lg select select-bordered select-sm shadow-sm steps tab tab-content table hover tabs tabs-box tabs-lg tab-active text-center text-error text-lg textarea textarea-bordered textarea-sm text-base-content/60 text-neutral-content text-sm text-xl text-xs toast toast-end toast-top toggle toggle-sm toggle-success w-11/12 w-44 w-full whitespace-pre-wrap font-sans text-[1.7rem]"></div> <div class="alert alert-error alert-info alert-success alert-warning badge badge-error badge-sm badge-success badge-warning bg-base-100 bg-base-200 bg-neutral bg-primary/10 border border-base-300 border-base-content/5 breadcrumbs btn btn-error btn-ghost btn-primary btn-secondary btn-sm btn-xs card card-body card-title checkbox checkbox-sm cursor-pointer flex flex-1 flex-col flex-wrap font-bold font-medium font-mono font-semibold gap-1 gap-2 gap-3 hidden inline input input-bordered input-sm items-center items-start mx-auto join join-item link list-disc loading loading-spinner loading-xs max-h-48 max-w-2xl max-w-xs mb-1 mb-2.5 mb-3 mb-4 mb-5 mb-6 ml-2 modal modal-action modal-backdrop modal-box mt-2 mt-3 mt-4 mt-5 my-2 my-4 overflow-x-auto overflow-y-auto p-3 p-4 pt-1 pt-2 pl-5 px-4 py-1 py-3 py-4 radio radio-sm rounded-box rounded-lg select select-bordered select-sm shadow-sm steps tab tab-content table hover tabs tabs-box tabs-lg tab-active text-center text-error text-lg textarea textarea-bordered textarea-sm text-base-content/60 text-neutral-content text-sm text-xl text-xs toggle toggle-sm toggle-success w-11/12 w-44 w-full whitespace-pre-wrap font-sans text-[1.7rem]"></div>

View File

@@ -710,14 +710,13 @@ function gnizaToast(type, msg) {
if (!toast) { if (!toast) {
toast = document.createElement('div'); toast = document.createElement('div');
toast.id = 'gniza-toast'; toast.id = 'gniza-toast';
toast.className = 'toast toast-end toast-top'; toast.style.cssText = 'position:fixed;top:12px;right:12px;z-index:9999;display:flex;flex-direction:column;gap:8px;max-width:400px';
toast.style.zIndex = '9999';
document.body.appendChild(toast); document.body.appendChild(toast);
} }
var el = document.createElement('div'); var el = document.createElement('div');
el.className = 'alert alert-' + type; el.className = 'alert alert-' + type;
el.style.cssText = 'transition:opacity .3s;box-shadow:0 4px 12px rgba(0,0,0,.15)';
el.textContent = msg; el.textContent = msg;
el.style.transition = 'opacity .3s';
toast.appendChild(el); toast.appendChild(el);
setTimeout(function() { el.style.opacity = '0'; }, type === 'error' ? 6000 : 3000); setTimeout(function() { el.style.opacity = '0'; }, type === 'error' ? 6000 : 3000);
setTimeout(function() { el.remove(); }, type === 'error' ? 6500 : 3500); setTimeout(function() { el.remove(); }, type === 'error' ? 6500 : 3500);

View File

@@ -315,14 +315,13 @@ function gnizaToast(type, msg) {
if (!toast) { if (!toast) {
toast = document.createElement('div'); toast = document.createElement('div');
toast.id = 'gniza-toast'; toast.id = 'gniza-toast';
toast.className = 'toast toast-end toast-top'; toast.style.cssText = 'position:fixed;top:12px;right:12px;z-index:9999;display:flex;flex-direction:column;gap:8px;max-width:400px';
toast.style.zIndex = '9999';
document.body.appendChild(toast); document.body.appendChild(toast);
} }
var el = document.createElement('div'); var el = document.createElement('div');
el.className = 'alert alert-' + type; el.className = 'alert alert-' + type;
el.style.cssText = 'transition:opacity .3s;box-shadow:0 4px 12px rgba(0,0,0,.15)';
el.textContent = msg; el.textContent = msg;
el.style.transition = 'opacity .3s';
toast.appendChild(el); toast.appendChild(el);
setTimeout(function() { el.style.opacity = '0'; }, type === 'error' ? 6000 : 3000); setTimeout(function() { el.style.opacity = '0'; }, type === 'error' ? 6000 : 3000);
setTimeout(function() { el.remove(); }, type === 'error' ? 6500 : 3500); setTimeout(function() { el.remove(); }, type === 'error' ? 6500 : 3500);