summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah (ctucx) <leah@ctu.cx>2021-03-05 23:10:43 +0100
committerLeah (ctucx) <leah@ctu.cx>2021-03-05 23:10:43 +0100
commitfff8c358ca194b9b87881054bb596d9b4a3727bb (patch)
treedd4c6be7e34a1327d8c4cb5d029aea7a86465327
parentf769d3e24676b1cec9f950b985a55f3dff36aa2e (diff)
downloadwebmusic-nginx-fff8c358ca194b9b87881054bb596d9b4a3727bb.tar.gz
webmusic-nginx-fff8c358ca194b9b87881054bb596d9b4a3727bb.tar.bz2
webmusic-nginx-fff8c358ca194b9b87881054bb596d9b4a3727bb.zip
oopsie: add function that i forgot to commit
-rw-r--r--webmusic.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/webmusic.js b/webmusic.js
index 24de390..03e57a3 100644
--- a/webmusic.js
+++ b/webmusic.js
@@ -142,6 +142,14 @@ function initState() {
total = queue.length;
}
+function previousTrack() {
+ if (index-- === 0)
+ index = total-1;
+ if (continuelist) {
+ playSong(queue[index])
+ }
+}
+
function nextTrack() {
if (++index === total)
index = 0;