diff options
| author | julian laplace <julescarbon@gmail.com> | 2022-10-26 21:46:51 +0200 |
|---|---|---|
| committer | julian laplace <julescarbon@gmail.com> | 2022-10-26 21:46:51 +0200 |
| commit | 76bead776ed0380ab6d1ebf7cb133cc797ae7d54 (patch) | |
| tree | ee40ee0e985c78e2baedb92071bdd9ee090fe832 /public/assets/js/lib/views | |
| parent | d746dffc069fcec569081db951f72ef816625b19 (diff) | |
reset current index, for now
Diffstat (limited to 'public/assets/js/lib/views')
| -rw-r--r-- | public/assets/js/lib/views/details/audio.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/public/assets/js/lib/views/details/audio.js b/public/assets/js/lib/views/details/audio.js index 30c5efd..fb72e0b 100644 --- a/public/assets/js/lib/views/details/audio.js +++ b/public/assets/js/lib/views/details/audio.js @@ -26,6 +26,7 @@ var audio = (function () { audio.index = function () { music = []; + current_index = -1; var links = document.querySelectorAll("a"); Array.prototype.slice.apply(links).forEach(function (link) { if (!link.href.match(/\.(mp3|wav|aiff?|m4a|ogg|opus|flac)$/)) return; @@ -70,7 +71,9 @@ var audio = (function () { audio.set_cursor = function () { selected = document.querySelector(".playing"); if (selected) selected.classList.remove("playing"); - music[current_index].classList.add("playing"); + if (current_index > -1) { + music[current_index].classList.add("playing"); + } }; audio.prev = function () { |
