diff --git a/code/html/custom.js b/code/html/custom.js index e513218b..e0646b30 100644 --- a/code/html/custom.js +++ b/code/html/custom.js @@ -300,10 +300,18 @@ function sendConfig(data) { websock.send(JSON.stringify({config: data})); } -function resetOriginals() { +function setOriginalsFromValues(force) { + var force = (true === force); $("input,select").each(function() { - $(this).attr("original", $(this).val()); + var initial = (null === $(this).attr("original")); + if (force || initial) { + $(this).attr("original", $(this).val()); + } }); +} + +function resetOriginals() { + setOriginalsFromValues(true); numReboot = numReconnect = numReload = 0; } @@ -1458,7 +1466,7 @@ function processData(data) { generateAPIKey(); } - resetOriginals(); + setOriginalsFromValues(); }