enable mode selection
This commit is contained in:
parent
04c85e10ba
commit
1353a57990
3 changed files with 31 additions and 158 deletions
|
@ -68,6 +68,27 @@ function initNumberInputs(container = document) {
|
|||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Store and retrieve radio button state
|
||||
const radioButtons = document.querySelectorAll('input[name="mode"]');
|
||||
|
||||
// Load saved state on page load
|
||||
const savedMode = localStorage.getItem('selectedMode');
|
||||
if (savedMode) {
|
||||
const radioToCheck = document.getElementById(savedMode);
|
||||
if (radioToCheck) {
|
||||
radioToCheck.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Save state when radio button changes
|
||||
radioButtons.forEach(radio => {
|
||||
radio.addEventListener('change', function() {
|
||||
if (this.checked) {
|
||||
localStorage.setItem('selectedMode', this.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Bootstrap Modal handling
|
||||
const htmxModal = document.getElementById('htmxModal');
|
||||
if (htmxModal) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue