From e3fd967ad7781a622c895b8e0c8cfb79b09b7741 Mon Sep 17 00:00:00 2001 From: Guillaume Hanotel Date: Fri, 29 Jan 2021 20:14:27 +0100 Subject: [PATCH] feat: ability to open search result in new tab with middle-click (#2919) --- client/components/common/search-results.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/components/common/search-results.vue b/client/components/common/search-results.vue index b96e5989..a71fd133 100644 --- a/client/components/common/search-results.vue +++ b/client/components/common/search-results.vue @@ -18,7 +18,7 @@ v-subheader.white--text {{$t('common:header.searchResultsCount', { total: response.totalHits })}} v-list.search-results-items.radius-7.py-0(two-line, dense) template(v-for='(item, idx) of results') - v-list-item(@click='goToPage(item)', :key='item.id', :class='idx === cursor ? `highlighted` : ``') + v-list-item(@click='goToPage(item)', @click.middle="goToPageInNewTab(item)", :key='item.id', :class='idx === cursor ? `highlighted` : ``') v-list-item-avatar(tile) img(src='/_assets/svg/icon-selective-highlighting.svg') v-list-item-content @@ -136,6 +136,9 @@ export default { }, goToPage(item) { window.location.assign(`/${item.locale}/${item.path}`) + }, + goToPageInNewTab(item) { + window.open(`/${item.locale}/${item.path}`, '_blank') } }, apollo: {