From a855b63d466b5623be61d23f843cbe9782954a4d Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Wed, 4 Sep 2024 20:05:57 +0200 Subject: [PATCH] Change click type --- app/components/App/Tab.vue | 1 - app/pages/[user].vue | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/components/App/Tab.vue b/app/components/App/Tab.vue index 6902a7a..6a24391 100644 --- a/app/components/App/Tab.vue +++ b/app/components/App/Tab.vue @@ -51,7 +51,6 @@ function openDeleteTabModal(tab: TabType) { function visitLink(clickType: 'self' | 'extern') { if (!props.editMode) { window.open(props.tab.link, clickType === 'self' ? '_self' : '_blank') - // todo: add view count } } diff --git a/app/pages/[user].vue b/app/pages/[user].vue index fc8e152..980e520 100644 --- a/app/pages/[user].vue +++ b/app/pages/[user].vue @@ -27,9 +27,8 @@ onMounted(() => { } }) -function visitLink(link: string) { - window.open(link, '_blank') - // todo: add view count +function visitLink(clickType: 'self' | 'extern') { + window.open(props.tab.link, clickType === 'self' ? '_self' : '_blank') } @@ -105,7 +104,10 @@ function visitLink(link: string) { body: { base: 'cursor-pointer h-full relative z-20' }, background: 'h-full duration-300 bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800', }" - @click.prevent="visitLink(tab.link)" + @click.left="visitLink('self')" + @click.right="visitLink('extern')" + @click.prevent="visitLink('self')" + @click.middle="visitLink('extern')" >