diff --git a/frontend/src/components/CollageHero.vue b/frontend/src/components/CollageHero.vue index 3bcbf9c..01f9d33 100644 --- a/frontend/src/components/CollageHero.vue +++ b/frontend/src/components/CollageHero.vue @@ -3,8 +3,9 @@
@@ -425,7 +433,7 @@ function handleKeyDown(e: KeyboardEvent) { const item = collageItems.value[focusedIndex.value] e.preventDefault() e.stopPropagation() - if (item) handleItemClick(item, focusedIndex.value) + if (item) activateItem(item, focusedIndex.value) } return } @@ -606,13 +614,36 @@ function getPlayLabel(item: MediaItem): string { return props.hasResumePosition(getPlayableFile(item)) ? "Continue" : "Play" } -function handleItemClick(item: MediaItem, index: number) { +function getItemHref(item: MediaItem): string { + return `#/${item.type}/${item.id}` +} + +function activateItem(item: MediaItem, index: number) { if (index === 0) { emit("info", item) } else { emit("select", item) } } + +function handleItemClick(event: MouseEvent, item: MediaItem, index: number) { + if (index === 0) { + emit("info", item) + return + } + // Let modified clicks navigate natively + if ( + event.button !== 0 || + event.ctrlKey || + event.metaKey || + event.shiftKey || + event.altKey + ) { + return + } + event.preventDefault() + emit("select", item) +}