Added fix for UI2 to now show the back value when there is only one option (use redo to go restore it)

This commit is contained in:
ebolam
2022-11-26 17:24:04 -05:00
parent 2d78d9400b
commit 498d999a06

View File

@@ -266,6 +266,30 @@ function create_options(action) {
while (option_chunk.firstChild) { while (option_chunk.firstChild) {
option_chunk.removeChild(option_chunk.firstChild); option_chunk.removeChild(option_chunk.firstChild);
} }
//Let's check if we only have a single redo option. In that case we din't show as the user can use the redo button
seen_prev_selection = false;
show_options = false;
console.log(action.action.Options);
for (item of action.action.Options) {
if (!(item['Previous Selection'])) {
console.log(item);
show_options = true;
break;
} else if (item['Previous Selection']) {
if (seen_prev_selection) {
show_options = true;
break;
} else {
seen_prev_selection = true;
}
}
}
console.log("seen_prev_selection: "+seen_prev_selection+" show_options: "+show_options);
if (!(show_options)) {
return;
}
var table = document.createElement("div"); var table = document.createElement("div");
table.classList.add("sequences"); table.classList.add("sequences");
//Add Redo options //Add Redo options