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,6 +534,16 @@ 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() {
if (player_build) {
for (const id of editable_item_fields) {
let edit_input = document.getElementById(id);
let value_label = document.getElementById(id + "-base");
edit_input.value = value_label.value;
edit_input.placeholder = value_label.value;
}
} else {
//no player build, reset to 0
for (const id of editable_item_fields) { for (const id of editable_item_fields) {
let edit_input = document.getElementById(id); let edit_input = document.getElementById(id);
@ -541,6 +551,7 @@ function resetEditableIDs() {
edit_input.placeholder = 0; edit_input.placeholder = 0;
} }
} }
}
/* Updates all spell boosts /* Updates all spell boosts
*/ */