summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah (ctucx) <leah@ctu.cx>2021-03-07 17:03:52 +0100
committerLeah (ctucx) <leah@ctu.cx>2021-03-07 17:03:52 +0100
commit7a2967b6d600f9e00366bf4bf468eb13df7d5efa (patch)
tree1a4d0d1666a370ad7664e75e69f321e5627c5765
parent5e30210d41733571eaa2653f50ecfc869faace89 (diff)
downloadwebmusic-nginx-7a2967b6d600f9e00366bf4bf468eb13df7d5efa.tar.gz
webmusic-nginx-7a2967b6d600f9e00366bf4bf468eb13df7d5efa.tar.bz2
webmusic-nginx-7a2967b6d600f9e00366bf4bf468eb13df7d5efa.zip
webmusic.js: use const for audioplayer and variable element in function playSong
-rw-r--r--webmusic.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/webmusic.js b/webmusic.js
index e290c80..165dbdc 100644
--- a/webmusic.js
+++ b/webmusic.js
@@ -1,12 +1,12 @@
'use strict';
-let audioPlayer = new Audio();
-let selectedItem = 0;
-let playingItem = 0;
-let playerState = "idle";
-let continuous = true;
-let repeat = false;
-let total = 0;
+const audioPlayer = new Audio();
+let selectedItem = 0;
+let playingItem = 0;
+let playerState = "idle";
+let continuous = true;
+let repeat = false;
+let total = 0;
const handleKeyEvent = (event) => {
switch (event.key) {
@@ -148,7 +148,7 @@ const updateButtonState = () => {
const playSong = (id) => {
- let element = document.getElementById(id);
+ const element = document.getElementById(id);
if (element === null) return;
if (element.classList.contains('dir')) return;