diff --git a/plugins/lyrics-genius/front.js b/plugins/lyrics-genius/front.js index 9e9d9216e5..e708964aa9 100644 --- a/plugins/lyrics-genius/front.js +++ b/plugins/lyrics-genius/front.js @@ -11,7 +11,7 @@ module.exports = () => { } // Check if disabled - if (!tabs.lyrics || !tabs.lyrics.hasAttribute("disabled")) { + if (!tabs.lyrics?.hasAttribute("disabled")) { return; } @@ -40,14 +40,12 @@ module.exports = () => { return; } - tabs.lyrics.removeAttribute("disabled"); - tabs.lyrics.removeAttribute("aria-disabled"); + enableLyricsTab(); - for (tab of [tabs.upNext, tabs.discover]){ - tab.onclick = () => { - tabs.lyrics.removeAttribute("disabled"); - tabs.lyrics.removeAttribute("aria-disabled"); - }; + for (tab of [tabs.upNext, tabs.discover]) { + if (tab) { + tab.onclick = enableLyricsTab; + } } checkLyricsContainer(); @@ -74,12 +72,16 @@ module.exports = () => { } } - function setLyrics(lyricsContainer){ + function setLyrics(lyricsContainer) { lyricsContainer.innerHTML = `
${lyrics} Source : Genius
`; + enableLyricsTab() + } + + function enableLyricsTab() { tabs.lyrics.removeAttribute("disabled"); tabs.lyrics.removeAttribute("aria-disabled"); } diff --git a/plugins/lyrics-genius/style.css b/plugins/lyrics-genius/style.css index 2712807259..26100bab0f 100644 --- a/plugins/lyrics-genius/style.css +++ b/plugins/lyrics-genius/style.css @@ -6,7 +6,7 @@ text-decoration: none; } -#contents.genius-lyrics, .description { - font-size: 1.1vw !important; +.description { + font-size: 1.1vw !important; text-align: center !important; }