Handle middle mouse button clicks (#13678)

* Handle middle mouse button clicks

* Fix up
This commit is contained in:
Nicolas Mowen 2024-09-11 11:26:01 -06:00 committed by GitHub
parent 3972642ba0
commit 22ee6bb137
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View File

@ -131,6 +131,11 @@ export function AnimatedEventCard({
<div <div
className="size-full cursor-pointer overflow-hidden rounded md:rounded-lg" className="size-full cursor-pointer overflow-hidden rounded md:rounded-lg"
onClick={onOpenReview} onClick={onOpenReview}
onAuxClick={() =>
window
.open(`${baseUrl}review?id=${event.id}`, "_blank")
?.focus()
}
> >
{!alertVideos ? ( {!alertVideos ? (
<img <img

View File

@ -19,6 +19,7 @@ import { capitalizeFirstLetter } from "@/utils/stringUtil";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { TbExclamationCircle } from "react-icons/tb"; import { TbExclamationCircle } from "react-icons/tb";
import { TooltipPortal } from "@radix-ui/react-tooltip"; import { TooltipPortal } from "@radix-ui/react-tooltip";
import { baseUrl } from "@/api/baseUrl";
type LivePlayerProps = { type LivePlayerProps = {
cameraRef?: (ref: HTMLDivElement | null) => void; cameraRef?: (ref: HTMLDivElement | null) => void;
@ -224,6 +225,9 @@ export default function LivePlayer({
className, className,
)} )}
onClick={onClick} onClick={onClick}
onAuxClick={() =>
window.open(`${baseUrl}#${cameraConfig.name}`, "_blank")?.focus()
}
> >
{((showStillWithoutActivity && !liveReady) || liveReady) && ( {((showStillWithoutActivity && !liveReady) || liveReady) && (
<> <>

View File

@ -20,6 +20,7 @@ import { capitalizeFirstLetter } from "@/utils/stringUtil";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { InProgressPreview, VideoPreview } from "../preview/ScrubbablePreview"; import { InProgressPreview, VideoPreview } from "../preview/ScrubbablePreview";
import { Preview } from "@/types/preview"; import { Preview } from "@/types/preview";
import { baseUrl } from "@/api/baseUrl";
type PreviewPlayerProps = { type PreviewPlayerProps = {
review: ReviewSegment; review: ReviewSegment;
@ -175,6 +176,9 @@ export default function PreviewThumbnailPlayer({
onMouseOver={isMobile ? undefined : () => setIsHovered(true)} onMouseOver={isMobile ? undefined : () => setIsHovered(true)}
onMouseLeave={isMobile ? undefined : () => setIsHovered(false)} onMouseLeave={isMobile ? undefined : () => setIsHovered(false)}
onClick={handleOnClick} onClick={handleOnClick}
onAuxClick={() =>
window.open(`${baseUrl}review?id=${review.id}`, "_blank")?.focus()
}
{...swipeHandlers} {...swipeHandlers}
> >
{playingBack && ( {playingBack && (