diff --git a/library/components/info/MapInfo.vue b/library/components/info/MapInfo.vue index 75d080f30..f4e8c1fb1 100644 --- a/library/components/info/MapInfo.vue +++ b/library/components/info/MapInfo.vue @@ -81,6 +81,13 @@ const props = defineProps({ * actually on screen (see "control mode" below). */ trigger: { type: String, default: 'floating', validator: (v) => ['floating', 'control'].includes(v) }, + /** + * With trigger 'control': the popup a MAP mounts for its own control when no host answers it (an + * embed, a standalone page). It never draws its own button, since the map's control is the only + * button; it answers that control from inside the map, points at it once per page load, and opens + * the same popup. It announces itself as local, so the control can tell it from a real host. + */ + popupOnly: { type: Boolean, default: false }, }) // ★ THE PAGE-LOAD POINTER (control mode). The pointer beside the map's own ⓘ shows ONCE PER PAGE LOAD: // the first time that control is on screen in the load. It goes for the rest of the load once the reader @@ -292,7 +299,7 @@ onMounted(() => { timer = window.setInterval(measureControl, 1500) window.addEventListener('resize', onResize) // A control that mounted before we did asked into the void; tell it to ask again. - try { window.dispatchEvent(new CustomEvent('dxmaps:mapinfo-host')) } catch { /* no CustomEvent */ } + try { window.dispatchEvent(new CustomEvent('dxmaps:mapinfo-host', { detail: { local: props.popupOnly } })) } catch { /* no CustomEvent */ } }) onBeforeUnmount(() => { if (pane) { @@ -305,7 +312,7 @@ onBeforeUnmount(() => { window.removeEventListener('resize', onResize) }) watch(open, (v) => { control.value?.setAttribute('aria-expanded', String(v)) }) -const floatingShown = () => props.trigger !== 'control' || (!awaitingControl.value && !controlShown.value) +const floatingShown = () => !props.popupOnly && (props.trigger !== 'control' || (!awaitingControl.value && !controlShown.value)) // The pointer beside the control has been on screen: this page load has pointed once, so a remount (the // gallery rebuilds a heavy tab on every switch back) does not point again. Marked on SCREEN, not on mount: // a tab's MapInfo can mount inside a hidden pane. diff --git a/library/components/legends/LegendMobile.vue b/library/components/legends/LegendMobile.vue index 6e0a5dd1e..58f983b94 100644 --- a/library/components/legends/LegendMobile.vue +++ b/library/components/legends/LegendMobile.vue @@ -1,5 +1,5 @@