summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah (ctucx) <leah@ctu.cx>2021-03-06 13:07:56 +0100
committerLeah (ctucx) <leah@ctu.cx>2021-03-06 13:07:56 +0100
commiteed52e44922c9b8cc8dd04b026eb5efa6a9bf8ef (patch)
tree95234d0fb050bc084dc6a37c432658ee4a9d6ef5
parentccc2c9adb3dead93b109aff535b1e6762f07b9c1 (diff)
click on back element instead of window.location override
-rw-r--r--webmusic.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/webmusic.js b/webmusic.js
index 014496a..2864bcd 100644
--- a/webmusic.js
+++ b/webmusic.js
@@ -51,7 +51,7 @@ window.onkeyup = function (event) {
sound.seek(sound.seek()+10);
}
else if (event.key === "Escape") {
- window.location = '../';
+ document.getElementById("back").click();
}
};
@@ -83,6 +83,7 @@ function playSong(url) {
src: [url],
html5: true
});
+
setState("loading");
sound.play();
sound.loop(repeat);
@@ -165,4 +166,4 @@ function formatTime(secs) {
const minutes = Math.floor(secs / 60) || 0;
const seconds = (secs - minutes * 60) || 0;
return minutes + ':' + (seconds < 10 ? '0' : '') + seconds;
-} \ No newline at end of file
+}