diff options
| author | Henry Jameson <me@hjkos.com> | 2018-12-04 11:38:00 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2018-12-04 11:38:00 +0300 |
| commit | 6d6d1102d9c899ef3f5e763949be691f7de9cdbd (patch) | |
| tree | f02a80429759b066958332c1fcb14d31fe0460f1 /src | |
| parent | 480f617c098c831e095a686abb319f4e467e15e4 (diff) | |
made links in user bio always open in new tabs
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/user_card_content/user_card_content.js | 8 | ||||
| -rw-r--r-- | src/components/user_card_content/user_card_content.vue | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js index b5dd9b91..9de27a9e 100644 --- a/src/components/user_card_content/user_card_content.js +++ b/src/components/user_card_content/user_card_content.js @@ -98,6 +98,14 @@ export default { const store = this.$store store.commit('setProfileView', { v }) } + }, + linkClicked ({target}) { + if (target.tagName === 'SPAN') { + target = target.parentNode + } + if (target.tagName === 'A') { + window.open(target.href, '_blank') + } } } } diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 84669d7f..87b2735a 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -105,7 +105,7 @@ <span v-if="!hideUserStatsLocal">{{user.followers_count}}</span> </div> </div> - <p v-if="!hideBio && user.description_html" class="profile-bio" v-html="user.description_html"></p> + <p @click.prevent="linkClicked" v-if="!hideBio && user.description_html" class="profile-bio" v-html="user.description_html"></p> <p v-else-if="!hideBio" class="profile-bio">{{ user.description }}</p> </div> </div> |
