mirror of
https://github.com/screentinker/screentinker.git
synced 2026-08-13 13:53:12 -06:00
Fix banner persistence across view switches and modal scroll on open
Co-authored-by: ChrisChrome <28414320+ChrisChrome@users.noreply.github.com>
This commit is contained in:
parent
4fe2552971
commit
1e278ea373
|
|
@ -1505,6 +1505,7 @@ body {
|
|||
.sidebar-backdrop.open { display: block; }
|
||||
.nav-link { min-height: 44px; padding: 10px 14px; }
|
||||
.content { margin-left: 0; padding: 16px; padding-top: 68px; }
|
||||
#banners { margin-left: 0; }
|
||||
.page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
|
||||
.device-grid { grid-template-columns: 1fr; }
|
||||
.content-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
|
||||
|
|
|
|||
|
|
@ -174,6 +174,8 @@
|
|||
</div>
|
||||
</nav>
|
||||
|
||||
<div id="banners" style="margin-left:var(--sidebar-width)"></div>
|
||||
|
||||
<main class="content" id="app">
|
||||
<!-- Views rendered here -->
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -609,8 +609,8 @@ function updateVerifyBanner(user) {
|
|||
const unverified = user && user.email_verified === 0 && user.auth_provider === 'local';
|
||||
if (!unverified) { if (existing) existing.remove(); return; }
|
||||
if (existing) return;
|
||||
const appEl = document.getElementById('app');
|
||||
if (!appEl || !appEl.parentNode) return;
|
||||
const bannersEl = document.getElementById('banners');
|
||||
if (!bannersEl) return;
|
||||
const b = document.createElement('div');
|
||||
b.id = 'verifyBanner';
|
||||
b.style.cssText = 'background:var(--warning,#f59e0b);color:#1a1200;padding:9px 16px;font-size:13px;display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap';
|
||||
|
|
@ -624,7 +624,7 @@ function updateVerifyBanner(user) {
|
|||
catch { showToast(t('auth.verify_resend_failed'), 'error'); }
|
||||
});
|
||||
b.appendChild(btn);
|
||||
appEl.prepend(b);
|
||||
bannersEl.appendChild(b);
|
||||
}
|
||||
|
||||
function updateWidgetSandboxWarningBanner(user) {
|
||||
|
|
@ -632,8 +632,8 @@ function updateWidgetSandboxWarningBanner(user) {
|
|||
const disabled = !!user?.current_organization?.widget_sandbox_isolation_disabled;
|
||||
if (!disabled) { if (existing) existing.remove(); return; }
|
||||
if (existing) return;
|
||||
const appEl = document.getElementById('app');
|
||||
if (!appEl || !appEl.parentNode) return;
|
||||
const bannersEl = document.getElementById('banners');
|
||||
if (!bannersEl) return;
|
||||
const b = document.createElement('div');
|
||||
b.id = 'widgetSandboxWarningBanner';
|
||||
b.style.cssText = 'background:var(--danger,#dc2626);color:#fff;padding:10px 16px;font-size:13px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;font-weight:600';
|
||||
|
|
@ -646,7 +646,7 @@ function updateWidgetSandboxWarningBanner(user) {
|
|||
link.style.cssText = 'color:#fff;text-decoration:underline;font-weight:700';
|
||||
b.appendChild(text);
|
||||
b.appendChild(link);
|
||||
appEl.prepend(b);
|
||||
bannersEl.appendChild(b);
|
||||
}
|
||||
|
||||
// Initialize
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export function openTypeToConfirmModal(opts = {}) {
|
|||
const input = overlay.querySelector('#ttcInput');
|
||||
const confirmBtn = overlay.querySelector('#ttcConfirm');
|
||||
const errorEl = overlay.querySelector('#ttcError');
|
||||
input.focus();
|
||||
input.focus({ preventScroll: true });
|
||||
|
||||
const matches = () => input.value.trim() === String(expected);
|
||||
input.addEventListener('input', () => { confirmBtn.disabled = !matches(); });
|
||||
|
|
|
|||
Loading…
Reference in a new issue