mirror of
https://github.com/markuryy/shark.git
synced 2025-12-12 19:51:01 +00:00
refactor(ui): update albums interaction to double click for consistency
This commit is contained in:
@@ -124,8 +124,11 @@
|
|||||||
selectedArtistIndex = index;
|
selectedArtistIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleAlbumClick(album: Album, index: number) {
|
function handleAlbumClick(index: number) {
|
||||||
selectedAlbumIndex = index;
|
selectedAlbumIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleAlbumDoubleClick(album: Album) {
|
||||||
const artistEncoded = encodeURIComponent(album.artist);
|
const artistEncoded = encodeURIComponent(album.artist);
|
||||||
const albumEncoded = encodeURIComponent(album.title);
|
const albumEncoded = encodeURIComponent(album.title);
|
||||||
goto(`/albums/${artistEncoded}/${albumEncoded}`);
|
goto(`/albums/${artistEncoded}/${albumEncoded}`);
|
||||||
@@ -238,7 +241,8 @@
|
|||||||
{#each albums as album, i}
|
{#each albums as album, i}
|
||||||
<tr
|
<tr
|
||||||
class:highlighted={selectedAlbumIndex === i}
|
class:highlighted={selectedAlbumIndex === i}
|
||||||
onclick={() => handleAlbumClick(album, i)}
|
onclick={() => handleAlbumClick(i)}
|
||||||
|
ondblclick={() => handleAlbumDoubleClick(album)}
|
||||||
>
|
>
|
||||||
<td class="cover-cell">
|
<td class="cover-cell">
|
||||||
{#if album.coverArtPath}
|
{#if album.coverArtPath}
|
||||||
|
|||||||
Reference in New Issue
Block a user