diff --git a/onzer.riot b/onzer.riot index c48bef8..55686c6 100644 --- a/onzer.riot +++ b/onzer.riot @@ -24,12 +24,8 @@ }, click(e) { e.preventDefault(); - document.getElementById("song").style.backgroundColor = "#D1FAE5"; - document.getElementById("song").style.borderColor = "#6EE7B7"; - document.getElementById("album").style.backgroundColor = "#D1FAE5"; - document.getElementById("album").style.borderColor = "#6EE7B7"; - document.getElementById("artist").style.backgroundColor = "#D1FAE5"; - document.getElementById("artist").style.borderColor = "#6EE7B7"; + + this.clearButton(); switch (e.target.attributes.value.value) { case 'Songs': @@ -48,6 +44,14 @@ document.getElementById("album").style.borderColor = "#059669"; }; this.update(); + }, + clearButton() { + document.getElementById("song").style.backgroundColor = "#D1FAE5"; + document.getElementById("song").style.borderColor = "#6EE7B7"; + document.getElementById("album").style.backgroundColor = "#D1FAE5"; + document.getElementById("album").style.borderColor = "#6EE7B7"; + document.getElementById("artist").style.backgroundColor = "#D1FAE5"; + document.getElementById("artist").style.borderColor = "#6EE7B7"; } }