Keep the Maps canvas stable across PWA ribbon layouts
This commit is contained in:
parent
d001520a46
commit
19a6067c18
@ -22,7 +22,7 @@ The guard covers map selection, hierarchy and other same-origin in-application l
|
||||
|
||||
## Shared workspace surface
|
||||
|
||||
`workspace-surface.js/css` is used by Maps and Relationship Map. Maximise/Restore updates canonical command state and sizing without fitting/rebuilding geography or resetting view/selection/mode/Story scope. Escape first respects open menus/dialogs and active editing gestures. Maps hides redundant Maximise in standalone PWA mode. Relationship Map retains its prior PWA behaviour.
|
||||
`workspace-surface.js/css` is used by Maps and Relationship Map. Maximise/Restore updates canonical command state and sizing without fitting/rebuilding geography or resetting view/selection/mode/Story scope. Escape first respects open menus/dialogs and active editing gestures. Maps hides only redundant Maximise in standalone PWA mode, retaining the visible Workspace commands. Maps reserves consistent PWA caption height across Story lenses and observes chrome resizing so ribbon collapse/restore continues to fill the available space. Relationship Map retains its prior PWA behaviour.
|
||||
|
||||
## Story navigation and readability
|
||||
|
||||
|
||||
@ -13,3 +13,6 @@ html[data-standalone=true] .maps-story-web-search{display:none!important}
|
||||
#mapsCanvas.manipulating,#mapsCanvas.manipulating .maps-feature{cursor:grabbing}
|
||||
|
||||
.maps-story-details ol{list-style:none;padding-left:0}
|
||||
|
||||
/* Reserve room for two-line canonical context captions across Maps lenses. */
|
||||
html[data-standalone=true]:has(#mapsApp) .pd-ribbon-panel:not([hidden]){min-height:94px}
|
||||
|
||||
@ -312,7 +312,8 @@
|
||||
$('mapsFit').onclick=()=>fit();$('mapsFitSelection').onclick=()=>fit(doc?.features.filter(f=>selected.has(f.featureID)));$('mapsZoomIn').onclick=()=>zoom(1/1.25);$('mapsZoomOut').onclick=()=>zoom(1.25);
|
||||
window.PlotDirectorWorkspaceSurface.attach(app,$('mapsMaximise'),{className:'maps-maximised'});
|
||||
window.addEventListener('beforeunload',e=>{if(dirty){e.preventDefault();e.returnValue='';}});
|
||||
new ResizeObserver(()=>{const top=app.getBoundingClientRect().top;if(!app.classList.contains('maps-maximised'))app.style.setProperty('--maps-shell-top',Math.max(0,top)+'px');if(doc)render();}).observe(svg);
|
||||
const resizeWorkspace=()=>{const top=Math.max(0,app.getBoundingClientRect().top)+'px';if(!app.classList.contains('maps-maximised')&&app.style.getPropertyValue('--maps-shell-top')!==top)app.style.setProperty('--maps-shell-top',top);if(doc)render();};
|
||||
const workspaceResize=new ResizeObserver(resizeWorkspace);workspaceResize.observe(svg);const chrome=document.querySelector('.pd-application-header');if(chrome)workspaceResize.observe(chrome);
|
||||
const syncDisplayMode=()=>{$('mapsMaximise').hidden=!!window.PlotDirectorPwa?.standalone;};syncDisplayMode();window.matchMedia('(display-mode: standalone)').addEventListener('change',syncDisplayMode);
|
||||
app.dataset.mode=mode;library();locations();crumbs();details();updateButtons();
|
||||
$('mapsWelcome').hidden=!!doc;svg.style.visibility=doc?'visible':'hidden';$('mapsList').innerHTML=boot.maps.map(m=>`<a href="${url(m.mapID)}">${esc(m.name)} · ${esc(m.kind)}${m.parentMapID?' · detail of '+esc(boot.maps.find(p=>p.mapID===m.parentMapID)?.name||'parent map'):''}</a>`).join('');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user