From 906968b06c6efd90064e5faddcbf53f926fa82e4 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Wed, 8 Sep 2021 17:21:46 +0400 Subject: [PATCH] Got my hands to this file and moved $ fun coutside. ...What I was thinking back then?... --- radio/static/assets/js/main.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/radio/static/assets/js/main.js b/radio/static/assets/js/main.js index e8d8466..2c80c1a 100644 --- a/radio/static/assets/js/main.js +++ b/radio/static/assets/js/main.js @@ -1,6 +1,6 @@ -function updateRadioStatus() { - const $ = id => document.getElementById(id); +function $(id) { return document.getElementById(id); } +function updateRadioStatus() { fetch("/stats") .then(r => r.json()) .then(radio => { @@ -18,8 +18,6 @@ function updateRadioStatus() { } function updateLastPlayedSong() { - const $ = id => document.getElementById(id); - fetch('/lastsong') .then(r => r.json()) .then(last_played => {