mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 15:49:31 -07:00
add si units close #52
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user