Double clicking on the video now opens the extended view

canary
WolverinDEV 2020-11-17 11:01:03 +01:00
parent ae83459c30
commit 2783fff2f1
3 changed files with 8 additions and 3 deletions

View File

@ -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());

View File

@ -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: {},

View File

@ -159,7 +159,7 @@ const VideoContainer = React.memo((props: { videoId: string }) => {
return (
<div
className={cssStyle.videoContainer}
onDoubleClick={() => events.fire("action_set_spotlight", { videoId: props.videoId })}
onDoubleClick={() => events.fire("action_set_spotlight", { videoId: props.videoId, expend: true })}
onContextMenu={event => {
event.preventDefault()
}}