Browse Source

do not reset original attr every ws message

webui
Max Prokhorov 6 years ago
parent
commit
f59d747af1
1 changed files with 11 additions and 3 deletions
  1. +11
    -3
      code/html/custom.js

+ 11
- 3
code/html/custom.js View File

@ -300,10 +300,18 @@ function sendConfig(data) {
websock.send(JSON.stringify({config: data})); websock.send(JSON.stringify({config: data}));
} }
function resetOriginals() {
function setOriginalsFromValues(force) {
var force = (true === force);
$("input,select").each(function() { $("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; numReboot = numReconnect = numReload = 0;
} }
@ -1458,7 +1466,7 @@ function processData(data) {
generateAPIKey(); generateAPIKey();
} }
resetOriginals();
setOriginalsFromValues();
} }


Loading…
Cancel
Save