Skip to content
This repository has been archived by the owner on Jan 23, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from priscillank/assignment
Browse files Browse the repository at this point in the history
Update song-list.js
  • Loading branch information
priscillank authored Oct 30, 2019
2 parents 8f59a84 + c6b8780 commit f56056b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions scripts/song-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
album.songs.forEach( (song, index) => {
song.element = $(`
<tr>
<td>
<button>
<span class = "song-number">${index + 1}</span>
<span class = "ion-play"></span>
<span class = "ion-pause"></span>
</button>
<td>${song.title}</td>
<td>${song.duration}</td>
</tr>
`);

song.element.on('click', event => {
player.playPause(song);
});

$('#song-list').append(song.element);
});
}

0 comments on commit f56056b

Please sign in to comment.