From 2783fff2f168b4c582ac3d98dfb9c3bdaef59a46 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Tue, 17 Nov 2020 11:01:03 +0100 Subject: [PATCH] Double clicking on the video now opens the extended view --- shared/js/ui/frames/video/Controller.ts | 7 ++++++- shared/js/ui/frames/video/Definitions.ts | 2 +- shared/js/ui/frames/video/Renderer.tsx | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/shared/js/ui/frames/video/Controller.ts b/shared/js/ui/frames/video/Controller.ts index a924563e..a69f1881 100644 --- a/shared/js/ui/frames/video/Controller.ts +++ b/shared/js/ui/frames/video/Controller.ts @@ -245,7 +245,12 @@ class ChannelVideoController { this.events.fire_react("notify_expended", { expended: this.expended }); }); - this.events.on("action_set_spotlight", event => this.setSpotlight(event.videoId)); + this.events.on("action_set_spotlight", event => { + this.setSpotlight(event.videoId); + if(!this.isExpended()) { + this.events.fire("action_toggle_expended", { expended: true }); + } + }); this.events.on("query_expended", () => this.events.fire_react("notify_expended", { expended: this.expended })); this.events.on("query_videos", () => this.notifyVideoList()); diff --git a/shared/js/ui/frames/video/Definitions.ts b/shared/js/ui/frames/video/Definitions.ts index fbc523a2..8b39349e 100644 --- a/shared/js/ui/frames/video/Definitions.ts +++ b/shared/js/ui/frames/video/Definitions.ts @@ -20,7 +20,7 @@ export type ChannelVideo ={ export interface ChannelVideoEvents { action_toggle_expended: { expended: boolean }, action_video_scroll: { direction: "left" | "right" }, - action_set_spotlight: { videoId: string | undefined }, + action_set_spotlight: { videoId: string | undefined, expend: boolean }, query_expended: {}, query_videos: {}, diff --git a/shared/js/ui/frames/video/Renderer.tsx b/shared/js/ui/frames/video/Renderer.tsx index 16988145..53ddf154 100644 --- a/shared/js/ui/frames/video/Renderer.tsx +++ b/shared/js/ui/frames/video/Renderer.tsx @@ -159,7 +159,7 @@ const VideoContainer = React.memo((props: { videoId: string }) => { return (
events.fire("action_set_spotlight", { videoId: props.videoId })} + onDoubleClick={() => events.fire("action_set_spotlight", { videoId: props.videoId, expend: true })} onContextMenu={event => { event.preventDefault() }}