From 5717a8bc7ea2e1394b3364cc31ae26083041ca3c Mon Sep 17 00:00:00 2001 From: Dayoung Lee Date: Tue, 26 Sep 2023 13:53:27 +0900 Subject: [PATCH] Update media/CfgEditor/index.js Co-authored-by: Seungho Henry Park <136296779+shs-park@users.noreply.github.com> ONE-vscode-DCO-1.0-Signed-off-by: Dayoung Lee --- media/CfgEditor/index.js | 43 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/media/CfgEditor/index.js b/media/CfgEditor/index.js index 82bfcf5f..62d2bdaf 100644 --- a/media/CfgEditor/index.js +++ b/media/CfgEditor/index.js @@ -347,28 +347,29 @@ function registerOptimizeOptions() { }); for (const optName in oneOptimizationList) { - if (Object.prototype.hasOwnProperty.call(oneOptimizationList, optName)) { - let row = document.createElement("vscode-data-grid-row"); - - let cellSwitch = document.createElement("vscode-data-grid-cell"); - let checkbox = document.createElement("vscode-checkbox"); - checkbox.setAttribute("id", "checkboxOptimize" + optName); - cellSwitch.appendChild(checkbox); - cellSwitch.setAttribute("grid-column", "1"); - row.appendChild(cellSwitch); - - let cellName = document.createElement("vscode-data-grid-cell"); - cellName.textContent = optName; - cellName.setAttribute("grid-column", "2"); - row.appendChild(cellName); - - let cellDescription = document.createElement("vscode-data-grid-cell"); - cellDescription.textContent = oneOptimizationList[optName].description; - cellDescription.setAttribute("grid-column", "3"); - row.appendChild(cellDescription); - - basicOptimizeTable.appendChild(row); + if (!Object.prototype.hasOwnProperty.call(oneOptimizationList, optName)) { + continue; } + let row = document.createElement("vscode-data-grid-row"); + + let cellSwitch = document.createElement("vscode-data-grid-cell"); + let checkbox = document.createElement("vscode-checkbox"); + checkbox.setAttribute("id", "checkboxOptimize" + optName); + cellSwitch.appendChild(checkbox); + cellSwitch.setAttribute("grid-column", "1"); + row.appendChild(cellSwitch); + + let cellName = document.createElement("vscode-data-grid-cell"); + cellName.textContent = optName; + cellName.setAttribute("grid-column", "2"); + row.appendChild(cellName); + + let cellDescription = document.createElement("vscode-data-grid-cell"); + cellDescription.textContent = oneOptimizationList[optName].description; + cellDescription.setAttribute("grid-column", "3"); + row.appendChild(cellDescription); + + basicOptimizeTable.appendChild(row); } for (const optName in oneOptimizationList) {