Fix a couple JavaScript errors
This commit is contained in:
parent
31a2719ca2
commit
d1fd1da54b
|
@ -30,15 +30,15 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const scrollCurrentSongIntoView = () => {
|
|
||||||
const hoveredSong = document.querySelector(".queue li:hover");
|
|
||||||
if (hoveredSong === null) {
|
|
||||||
const currentSong = document.querySelector(".queue li.playing");
|
|
||||||
currentSong.scrollIntoView({ block: "nearest" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
htmx.onLoad(() => {
|
htmx.onLoad(() => {
|
||||||
|
const scrollCurrentSongIntoView = () => {
|
||||||
|
const hoveredSong = document.querySelector(".queue li:hover");
|
||||||
|
if (hoveredSong === null) {
|
||||||
|
const currentSong = document.querySelector(".queue li.playing");
|
||||||
|
currentSong?.scrollIntoView({ block: "nearest" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const isReduced = window
|
const isReduced = window
|
||||||
.matchMedia("(prefers-reduced-motion: reduce)")
|
.matchMedia("(prefers-reduced-motion: reduce)")
|
||||||
.matches;
|
.matches;
|
||||||
|
|
Loading…
Reference in New Issue