If the options list changes, automatically select the highest possible available choice for the user.

main
sigonasr2, Sig, Sigo 4 years ago committed by GitHub
parent 2349985cfc
commit 2718eb9c66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      muni.js

@ -57,11 +57,17 @@ const MAXSTEPS= 10000
if (isBonus) {
for (var i = 0; i < bonusOptions['bonus'].length; i++) {
var entry = new Option(bonusOptions['bonus'][i] + "%", bonusOptions['bonus'][i] / 100);
if (i==bonusOptions['bonus'].length-1) {
entry.selected=true;
}
bonusList.options.add(entry);
}
} else {
for (var i = 0; i < bonusOptions['noBonus'].length; i++) {
var entry = new Option(bonusOptions['noBonus'][i] + "%", bonusOptions['noBonus'][i] / 100);
if (i==bonusOptions['noBonus'].length-1) {
entry.selected=true;
}
bonusList.options.add(entry);
}
}

Loading…
Cancel
Save