diff --git a/plugin-designs/regions-dashboard/region-dashboards.vue b/plugin-designs/regions-dashboard/region-dashboards.vue index f5bd264f8..064126925 100644 --- a/plugin-designs/regions-dashboard/region-dashboards.vue +++ b/plugin-designs/regions-dashboard/region-dashboards.vue @@ -627,6 +627,16 @@ function onPopState() { // One watcher rather than a writeUrl() call at each of the five places a selection is made // (tab-1 event, table row, region dropdown, country dropdown, back-link) — those would drift. +// ★ A NEW SUBJECT OPENS AT ITS TOP. Picking a region from the all-regions table, or a country from a region, +// kept the old scroll height, so the reader landed at the bottom of the new page (reported on a phone). The +// scroller is this dashboard's own
, the one the Back-to-top button drives. Switching to the list and +// back selects nothing new, so the selected dashboard keeps its place there. A string key, because an array +// literal is a new object on every run and would fire on no change. +watch(() => `${sel.value.regionSlug}|${sel.value.countrySlug}`, () => { + const el = scrollEl.value + if (el && el.scrollTop > 0) el.scrollTo({ top: 0, behavior: 'auto' }) +}, { flush: 'post' }) + watch(() => [sel.value.regionSlug, sel.value.countrySlug], () => { // No guard needed: writeUrl() is idempotent, so the call this watcher makes after a popstate // writes nothing. (Deleting the declaration while leaving `if (applyingHistory) return` here @@ -936,6 +946,11 @@ useShadowStyles( '.rd-mapnote{ margin:0; text-align:center; color:#92b195; font-weight:700; font-size:var(--font-size-md); }' + // .rounded-xlg on their ; the child takes border-radius:inherit from here. '.rd-mapframe{ border-radius:var(--dx-radius); overflow:hidden; }' + + // ★ A SQUARE MAP ON PHONES, for a region and a country too (asked for on a phone: "like the all-regions + // map"). RegionCountryMap keeps DX Life's cloned 1/2 portrait under 768px for its other consumer (the + // country page's country-map), so the override lives HERE, scoped to this dashboard's frame: two classes + // outrank the component's one. The all-regions chooser was already square (.rcm--chooser). + '@media (max-width:768px){ .rd-mapframe .rcm{ aspect-ratio:1/1; } }' + // The region key. Their token scale throughout so the one screen we add does not look // foreign next to the clone: --spacing-xs/sm gaps, --font-size-sm, the 100px pill radius // their chips use, and --color-brand-lighter for the count. diff --git a/public/dx-maps/doxa-maps-spa/manifest.json b/public/dx-maps/doxa-maps-spa/manifest.json index 3ff4e9e8c..977bb950c 100644 --- a/public/dx-maps/doxa-maps-spa/manifest.json +++ b/public/dx-maps/doxa-maps-spa/manifest.json @@ -1126,7 +1126,7 @@ "bundle": "regions-dashboard", "scriptUrl": "./regions-dashboard/regions-dashboard.js", "output": "dx-maps/regions-dashboard/regions-dashboard.js", - "integrity": "sha384-/uFI1EDUJJJ3IlToqOlEUndMNJb/1IEFrHgTLLffP0AFue9fkSaztIsUIEUWqVc4", + "integrity": "sha384-Fbd+YPbfDujlrE+xmxmTDyk8fJk708fnJ9BDWweu4gVFaevTYj4wcUB6S8pwsGaF", "elements": [ "regions-dashboard" ], @@ -1149,8 +1149,8 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -1166,7 +1166,7 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } }, { @@ -1182,8 +1182,8 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } } ] diff --git a/public/dx-maps/manifest.json b/public/dx-maps/manifest.json index 3ff4e9e8c..977bb950c 100644 --- a/public/dx-maps/manifest.json +++ b/public/dx-maps/manifest.json @@ -1126,7 +1126,7 @@ "bundle": "regions-dashboard", "scriptUrl": "./regions-dashboard/regions-dashboard.js", "output": "dx-maps/regions-dashboard/regions-dashboard.js", - "integrity": "sha384-/uFI1EDUJJJ3IlToqOlEUndMNJb/1IEFrHgTLLffP0AFue9fkSaztIsUIEUWqVc4", + "integrity": "sha384-Fbd+YPbfDujlrE+xmxmTDyk8fJk708fnJ9BDWweu4gVFaevTYj4wcUB6S8pwsGaF", "elements": [ "regions-dashboard" ], @@ -1149,8 +1149,8 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -1166,7 +1166,7 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } }, { @@ -1182,8 +1182,8 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } } ] diff --git a/public/dx-maps/regions-dashboard/region-dashboards/index.html b/public/dx-maps/regions-dashboard/region-dashboards/index.html index 69075ada8..ef18cb936 100644 --- a/public/dx-maps/regions-dashboard/region-dashboards/index.html +++ b/public/dx-maps/regions-dashboard/region-dashboards/index.html @@ -70,7 +70,7 @@ - + - + - +