add si units close #52

This commit is contained in:
Matt Walsh
2025-02-23 23:29:39 -06:00
parent 94470db9a7
commit af53cca45e
15 changed files with 204 additions and 57 deletions

View File

@@ -18,6 +18,10 @@ const init = () => {
[1.25, 'Slow'],
[1.5, 'Very Slow'],
]);
settings.units = new Setting('units', 'Units', 'select', 'us', unitChange, true, [
['us', 'US'],
['si', 'Metric'],
]);
// generate html objects
const settingHtml = Object.values(settings).map((d) => d.generate());
@@ -47,4 +51,13 @@ const kioskChange = (value) => {
}
};
const unitChange = () => {
// reload the data at the top level to refresh units
// after the initial load
if (unitChange.firstRunDone) {
window.location.reload();
}
unitChange.firstRunDone = true;
};
export default settings;