diff --git a/src/components/VideoCard/VideoCard.vue b/src/components/VideoCard/VideoCard.vue index 4aa98fb2..deb114ba 100644 --- a/src/components/VideoCard/VideoCard.vue +++ b/src/components/VideoCard/VideoCard.vue @@ -208,6 +208,7 @@ function handleClick(event: MouseEvent) { } function handleMoreBtnClick(event: MouseEvent) { + showVideoOptions.value = false videoOptionsFloatingStyles.value = { position: 'absolute', top: 0, @@ -282,6 +283,7 @@ function handleRemoved(selectedOpt?: { dislikeReasonId: number }) { @mouseenter="handleMouseEnter" @mouseleave="handelMouseLeave" @click="handleClick" + @click.right.prevent="handleMoreBtnClick" >
diff --git a/src/components/VideoCard/VideoCardContextMenu/VideoCardContextMenu.vue b/src/components/VideoCard/VideoCardContextMenu/VideoCardContextMenu.vue index 326edfd3..b96cfd3d 100644 --- a/src/components/VideoCard/VideoCardContextMenu/VideoCardContextMenu.vue +++ b/src/components/VideoCard/VideoCardContextMenu/VideoCardContextMenu.vue @@ -16,6 +16,7 @@ const props = defineProps<{ const emit = defineEmits<{ (event: 'removed', selectedOpt?: { dislikeReasonId: number }): void (event: 'close'): void + (event: 'reopen'): void }>() const videoOptions = reactive<{ id: number, name: string }[]>([ @@ -30,6 +31,8 @@ const { openIframeDrawer } = useBewlyApp() enum VideoOption { OpenInNewTab, + OpenInCurrentTab, + // OpenInBackground, OpenInNewWindow, OpenInDrawer, ViewTheOriginalCover, @@ -39,6 +42,8 @@ const commonOptions = computed((): { command: VideoOption, name: string, icon: s return [ [ { command: VideoOption.OpenInNewTab, name: 'Open in new tab', icon: 'i-solar:square-top-down-bold-duotone' }, + { command: VideoOption.OpenInCurrentTab, name: 'Open in current tab', icon: 'i-solar:square-top-down-bold-duotone' }, + // { command: VideoOption.OpenInBackground, name: 'Open in background', icon: 'i-solar:square-top-down-bold-duotone' }, { command: VideoOption.OpenInNewWindow, name: 'Open in new window', icon: 'i-solar:maximize-square-3-bold-duotone' }, { command: VideoOption.OpenInDrawer, name: 'Open in drawer', icon: 'i-solar:archive-up-minimlistic-bold-duotone' }, ], @@ -73,6 +78,15 @@ function handleCommonCommand(command: VideoOption) { window.open(props.video.url, '_blank') handleClose() break + case VideoOption.OpenInCurrentTab: + window.open(props.video.url, '_self') + handleClose() + break + // case VideoOption.OpenInBackground: + // // Open tab in background + // window.open(props.video.url, '_blank', 'background') + // handleClose() + // break case VideoOption.OpenInNewWindow: showPipWindow.value = true break @@ -99,6 +113,13 @@ function handleClose() { emit('close') } +function handleReopen() { + // showContextMenu.value = false + // showPipWindow.value = false + // console.log('reopen') + // emit('reopen') +} + function handleRemoved(selectedOpt?: { dislikeReasonId: number }) { emit('removed', selectedOpt) handleClose() @@ -107,64 +128,64 @@ function handleRemoved(selectedOpt?: { dislikeReasonId: number }) {