|
@@ -812,9 +812,10 @@
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ const maxIdx = (adList.length - 1) || 0;
|
|
|
adList.forEach((advance, adIndex) => {
|
|
|
let dispStr = '';
|
|
|
- if (!hasMatch && adIndex === 0 || current_advance_id === advance.id) {
|
|
|
+ if (!hasMatch && adIndex === maxIdx || current_advance_id === advance.id) {
|
|
|
current_advance_id = advance.id;
|
|
|
$("#btnCurrentAdvancePay")[0].innerText = `第${adIndex + 1}期`;
|
|
|
dispStr = ';display:none';
|
|
@@ -830,9 +831,10 @@
|
|
|
function buildMaterialSelection() {
|
|
|
$("#optionSelectableMaterials").empty();
|
|
|
$("#btnCurrentMaterial")[0].innerText = '';
|
|
|
+ const maxIdx = (MATERIAL_LIST.length - 1) || 0;
|
|
|
MATERIAL_LIST.forEach((materialAdj, maIndex) => {
|
|
|
let dispStr = '';
|
|
|
- if (current_material_id === -1 && maIndex === 0 || current_material_id === materialAdj.id) {
|
|
|
+ if (current_material_id === -1 && maIndex === maxIdx || current_material_id === materialAdj.id) {
|
|
|
current_material_id = materialAdj.id;
|
|
|
$("#btnCurrentMaterial")[0].innerText = `第${maIndex + 1}期`;
|
|
|
dispStr = ';display:none';
|