webmusic.js: hide selector when track selected

This commit is contained in:
Leah 2021-03-08 13:35:03 +01:00
parent 6a8708bcf8
commit bb01d955af
Signed by untrusted user: ctucx
GPG Key ID: 725B65F21DB1C2C4
1 changed files with 6 additions and 4 deletions

View File

@ -161,7 +161,6 @@ const updateButtonState = () => {
}
}
const playSong = (id) => {
const element = document.getElementById(id);
@ -172,16 +171,19 @@ const playSong = (id) => {
document.getElementsByClassName('playing')[0].classList.remove('playing');
}
playingItem = element.id;
if (document.getElementsByClassName('selected').length > 0) {
document.getElementsByClassName('selected')[0].classList.remove('selected');
}
audioPlayer.pause()
playingItem = element.id;
element.classList.add('playing');
audioPlayer.src = element.href;
setPlayerState('loading');
audioPlayer.load();
element.classList.add('playing');
}
const togglePlayback = () => {