mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(kit): render the pressed toggles with UiButton
UiButton gains pressedClass, Core's class on a pressed button. The pressed classes toggle through classList, so classes other code adds survive a press, a caller's class change keeps them, a renamed pressedClass leaves the button, and server-rendered markup carries them. The Display, SDR, Radio and Cockpit enable, Cockpit weather and briefing, mission replay, Street Level, TR-3B, overlay, voice and CCTV toggles now render through it with the same ids, classes and aria-pressed values.
This commit is contained in:
1 parent
5019bd9e8a
commit
d98a7c81be
23 files changed
+212
-62
No files matched your search
@@ -5,6 +5,7 @@ import { t } from '../../../i18n/index.js';
|
||||
import { createContextState } from '../../cockpitContextState.js';
|
||||
import { vClassToggle } from '../../rail/classToggle.js';
|
||||
import { useCockpitStore } from '../../stores/cockpit.js';
|
||||
import UiButton from '../../kit/UiButton.vue';
|
||||
|
||||
// The Cockpit Contact card. The Cockpit controller presents its scope,
|
||||
// navigation, cohort counts, nearest contact and weather toggle; until it
|
||||
@@ -64,10 +65,10 @@ const weatherLabel = computed(() =>
|
||||
</div>
|
||||
<footer class="cockpit-context-footer">
|
||||
<span id="cockpit-context-uncertainty">{{ c.uncertainty }}</span>
|
||||
<button id="cockpit-weather-toggle" class="cockpit-context-weather" type="button" :aria-label="weatherLabel" :aria-pressed="String(c.weather)" :title="weatherLabel">
|
||||
<UiButton id="cockpit-weather-toggle" class="cockpit-context-weather" :aria-label="weatherLabel" :pressed="Boolean(c.weather)" :title="weatherLabel">
|
||||
<span data-i18n>WX</span>
|
||||
<strong id="cockpit-weather-state">{{ c.weather ? t('ON') : t('OFF') }}</strong>
|
||||
</button>
|
||||
</UiButton>
|
||||
<time id="cockpit-context-updated">{{ c.updated }}</time>
|
||||
</footer>
|
||||
</aside>
|
||||
|
||||
Reference in new issue
Block a user