diff --git a/contents.js b/contents.js index 5b71aff..0efb915 100644 --- a/contents.js +++ b/contents.js @@ -59,18 +59,20 @@ function createIndexSection(contribution) { let table = document.createElement("table"); let title = document.createElement("h4"); title.innerHTML = contribution.title; - contribution.audio.forEach((track) => { - console.log(track); - // let row = document.createElement("tr"); - // let col1 = document.createElement("td"); - // let col2 = document.createElement("td"); - // col1.setAttribute("class", "symbol"); - // col2.setAttribute("class", "filename"); - // col2.innerHTML = track; - // row.appendChild(col1); - // row.appendChild(col2); - // table.appendChild(row); - }); + if (contribution.audio){ + let tracks = contribution.audio; + tracks.forEach((track) => { + let row = document.createElement("tr"); + let col1 = document.createElement("td"); + let col2 = document.createElement("td"); + col1.setAttribute("class", "symbol"); + col2.setAttribute("class", "filename"); + col2.innerHTML = track; + row.appendChild(col1); + row.appendChild(col2); + table.appendChild(row); + }); + } trackList.appendChild(title); trackList.appendChild(table); }