Skip to content

Commit b81cf5b

Browse files
committed
reset option fields on change
1 parent ef38821 commit b81cf5b

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

dist/server/public/app.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ function initializeExportTabs() {
200200
document.querySelectorAll('input[name="preset"]').forEach((radio) => {
201201
radio.checked = false
202202
})
203+
// Reset all option fields to their HTML defaults
204+
document
205+
.querySelectorAll('[name^="option_"]')
206+
.forEach((field) => {
207+
if (field.type === 'checkbox') {
208+
field.checked = field.defaultChecked
209+
} else {
210+
field.value = field.defaultValue
211+
}
212+
})
203213
}
204214
})
205215
})

src/server/public/app.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ function initializeExportTabs() {
200200
document.querySelectorAll('input[name="preset"]').forEach((radio) => {
201201
radio.checked = false
202202
})
203+
// Reset all option fields to their HTML defaults
204+
document
205+
.querySelectorAll('[name^="option_"]')
206+
.forEach((field) => {
207+
if (field.type === 'checkbox') {
208+
field.checked = field.defaultChecked
209+
} else {
210+
field.value = field.defaultValue
211+
}
212+
})
203213
}
204214
})
205215
})

0 commit comments

Comments
 (0)