From 024027a2daa0265ade7c060ef73317a28972f2f7 Mon Sep 17 00:00:00 2001 From: martbost Date: Fri, 11 Sep 2026 15:25:46 -0500 Subject: [PATCH] Campaign form: show the banner size and image rows at load (banner is the default type), not only after a type change Co-Authored-By: Claude Fable 5.1 --- public/assets/my.js | 7 +++++-- public/my.html | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public/assets/my.js b/public/assets/my.js index ce1f701..79921d5 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -599,6 +599,7 @@ // populate the banner-size dropdown once (ids map to NAS width/height) if (r.bannerSizes && $('cSize') && !$('cSize').options.length) $('cSize').innerHTML = r.bannerSizes.map(s => '').join(''); + applyType(); // the default type is banner: show its size + image rows now that the sizes exist soloHint(); if ($('spendBanner')) { $('spendBanner').hidden = false; @@ -709,7 +710,8 @@ visits: 'A distinct member opens your site in a new tab, stays eight seconds and passes a check. Nobody counts twice.' }; const whereHint = () => { const el = $('cWhere'); if (el) el.textContent = WHERE[$('cType').value] || ''; }; whereHint(); - $('cType').addEventListener('change', () => { + // runs on every type change AND once at load, so the default type (banner) shows its size + image rows immediately + function applyType() { // hoisted: loadCampaigns may run before this line is reached whereHint(); const t = $('cType').value; $('cImageRow').hidden = t !== 'banner'; // only banners carry a creative; login frames its URL @@ -734,7 +736,8 @@ soloHint(); if (t === 'video') videoHint(); if (t === 'featured') featHint(); - }); + } + $('cType').addEventListener('change', applyType); let featStartDay = 0; // selected start-day offset (0 = today) async function featHint() { if (!lastRates || !lastRates.featuredDurations) return; diff --git a/public/my.html b/public/my.html index 40fa80e..9ea846a 100644 --- a/public/my.html +++ b/public/my.html @@ -909,7 +909,7 @@ - +