fix reset editable IDs

This commit is contained in:
ferricles 2022-05-20 19:13:20 -07:00
parent 78317647db
commit 1c1964a814

View file

@ -534,11 +534,22 @@ function updateEditableIDs() {
/* Resets all IDs in the edit IDs section to their "original" values. /* Resets all IDs in the edit IDs section to their "original" values.
*/ */
function resetEditableIDs() { function resetEditableIDs() {
for (const id of editable_item_fields) { if (player_build) {
let edit_input = document.getElementById(id); for (const id of editable_item_fields) {
let edit_input = document.getElementById(id);
let value_label = document.getElementById(id + "-base");
edit_input.value = 0; edit_input.value = value_label.value;
edit_input.placeholder = 0; edit_input.placeholder = value_label.value;
}
} else {
//no player build, reset to 0
for (const id of editable_item_fields) {
let edit_input = document.getElementById(id);
edit_input.value = 0;
edit_input.placeholder = 0;
}
} }
} }