Fix dock panel visibility on mobile
This commit is contained in:
parent
a8fcab58eb
commit
846af246d9
@ -81,6 +81,7 @@ style.textContent = `
|
|||||||
font-family: Georgia, 'Times New Roman', serif;
|
font-family: Georgia, 'Times New Roman', serif;
|
||||||
}
|
}
|
||||||
#dock-overlay[hidden] { display: none; }
|
#dock-overlay[hidden] { display: none; }
|
||||||
|
#dock-overlay [hidden] { display: none !important; }
|
||||||
.dock-backdrop {
|
.dock-backdrop {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
@ -239,7 +240,11 @@ const panels = [...overlay.querySelectorAll('[data-panel]')];
|
|||||||
let latestState = null;
|
let latestState = null;
|
||||||
|
|
||||||
const setPanel = (name = 'home') => {
|
const setPanel = (name = 'home') => {
|
||||||
panels.forEach((panel) => { panel.hidden = panel.dataset.panel !== name; });
|
panels.forEach((panel) => {
|
||||||
|
const active = panel.dataset.panel === name;
|
||||||
|
panel.hidden = !active;
|
||||||
|
panel.setAttribute('aria-hidden', active ? 'false' : 'true');
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const actionButton = (label, action, extra = {}, disabled = false) => {
|
const actionButton = (label, action, extra = {}, disabled = false) => {
|
||||||
|
|||||||
@ -280,6 +280,9 @@ test('mobile controls enter a dock hub before shipyard, trade, or missions', asy
|
|||||||
assert.match(dockUi, /MISSIONS/);
|
assert.match(dockUi, /MISSIONS/);
|
||||||
assert.match(dockUi, /TRADE/);
|
assert.match(dockUi, /TRADE/);
|
||||||
assert.match(dockUi, /SHIPYARD/);
|
assert.match(dockUi, /SHIPYARD/);
|
||||||
|
assert.match(dockUi, /#dock-overlay \[hidden\] \{ display: none !important; \}/);
|
||||||
|
assert.match(dockUi, /panel\.hidden = !active/);
|
||||||
|
assert.match(dockUi, /panel\.setAttribute\('aria-hidden'/);
|
||||||
assert.match(dockUi, /dispatchAction\('open-shipyard'\)/);
|
assert.match(dockUi, /dispatchAction\('open-shipyard'\)/);
|
||||||
assert.match(hud, /buyButton\.textContent = badges\.length/);
|
assert.match(hud, /buyButton\.textContent = badges\.length/);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user