webmusic.js: hide selector when track selected
This commit is contained in:
parent
6a8708bcf8
commit
bb01d955af
10
webmusic.js
10
webmusic.js
|
@ -161,7 +161,6 @@ const updateButtonState = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const playSong = (id) => {
|
const playSong = (id) => {
|
||||||
const element = document.getElementById(id);
|
const element = document.getElementById(id);
|
||||||
|
|
||||||
|
@ -172,16 +171,19 @@ const playSong = (id) => {
|
||||||
document.getElementsByClassName('playing')[0].classList.remove('playing');
|
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()
|
audioPlayer.pause()
|
||||||
|
|
||||||
|
playingItem = element.id;
|
||||||
|
element.classList.add('playing');
|
||||||
|
|
||||||
audioPlayer.src = element.href;
|
audioPlayer.src = element.href;
|
||||||
|
|
||||||
setPlayerState('loading');
|
setPlayerState('loading');
|
||||||
audioPlayer.load();
|
audioPlayer.load();
|
||||||
|
|
||||||
element.classList.add('playing');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const togglePlayback = () => {
|
const togglePlayback = () => {
|
||||||
|
|
Loading…
Reference in a new issue