diff options
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -32,9 +32,21 @@ document.addEventListener("DOMContentLoaded", function() { for (let element of elements) { element.addEventListener("input", settings_apply); } + + const reset_elements = document.getElementsByClassName(setting + "-reset"); + for (let reset_element of reset_elements) { + reset_element.addEventListener("click", () => reset_all(setting)); + } } +}); -}) +function reset_all(setting) { + console.log("reseting " + setting); + for (let element of settings[setting].elements) { + element.value = element.defaultValue; + } + draw(true); +} function take_picture() { document.body.classList.add("editor-enabled"); |