diff options
| author | Roger Braun <roger@rogerbraun.net> | 2017-02-19 12:58:25 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2017-02-19 12:58:25 +0100 |
| commit | 04c4ad9a6572167f049b833fc343b8eba819ac46 (patch) | |
| tree | d6240a1bb3a22bd9251f7db2ebaecd742ed8d37b /src | |
| parent | 73f46bfba68b80dc09d070ebc53310802c9a2046 (diff) | |
Open clicked links the statusnet_html in a new window.
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/attachment/attachment.js | 5 | ||||
| -rw-r--r-- | src/components/attachment/attachment.vue | 2 | ||||
| -rw-r--r-- | src/components/status/status.js | 5 | ||||
| -rw-r--r-- | src/components/status/status.vue | 2 |
4 files changed, 12 insertions, 2 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index c88497a2..57d21b28 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -20,6 +20,11 @@ const Attachment = { } }, methods: { + linkClicked ({target}) { + if (target.tagName === 'A') { + window.open(target.href, '_blank') + } + }, toggleHidden () { this.showHidden = !this.showHidden } diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index a294901b..738a1e86 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -18,7 +18,7 @@ <span v-if="type === 'unknown'">Don't know how to display this...</span> - <div v-if="type === 'html' && attachment.oembed" class="oembed"> + <div @click.prevent="linkClicked" v-if="type === 'html' && attachment.oembed" class="oembed"> <div v-if="attachment.thumb_url" class="image"> <img :src="attachment.thumb_url"></img> </div> diff --git a/src/components/status/status.js b/src/components/status/status.js index 030e22b5..e75400cb 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -40,6 +40,11 @@ const Status = { UserCardContent }, methods: { + linkClicked ({target}) { + if (target.tagName === 'A') { + window.open(target.href, '_blank') + } + }, toggleReplying () { this.replying = !this.replying }, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 47e14d28..162ab140 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -54,7 +54,7 @@ </small> </h4> - <div class="status-content" v-html="status.statusnet_html"></div> + <div @click.prevent="linkClicked" class="status-content" v-html="status.statusnet_html"></div> <div v-if='status.attachments' class='attachments'> <attachment :status-id="status.id" :nsfw="status.nsfw" :attachment="attachment" v-for="attachment in status.attachments"> |
