Skip to content

Commit

Permalink
fix: stop propagation of all click events + clear all link policy rew…
Browse files Browse the repository at this point in the history
…rites since they are now useless
  • Loading branch information
valeriansaliou committed Mar 10, 2024
1 parent f278d67 commit 745007d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/messaging/components/message/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const PRESENTATION_MIME_TYPES = {

const TEXT_LINKIFY_OPTIONS = {
defaultProtocol: "https",
target: "_blank",
nl2br: false,
truncate: TEXT_LINKS_TRUNCATE_SIZE
};
Expand Down Expand Up @@ -300,6 +299,7 @@ function MessagePartText(content) {
__onLinkClick(event) {
// Do not open link (let the implementing app choose what to do)
event.preventDefault();
event.stopPropagation();

// Handle link? (if any)
const linkUrl = event.target?.href || null;
Expand Down
11 changes: 3 additions & 8 deletions src/messaging/messaging.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,9 @@
<a
v-if="presentation === 'image'"
v-scope="FileImage(file)"
@click.prevent="onFileClick(line.id, viewAction)"
@click.prevent.stop="onFileClick(line.id, viewAction)"
:href="file.url"
class="file-image"
target="_blank"
rel="noopener"
>
<span
v-if="previewSize"
Expand All @@ -274,11 +272,9 @@
v-else-if="presentation === 'video'"
v-scope="FileVideo(file)"
@vue:mounted="mounted"
@click.prevent="onFileClick(line.id, viewAction)"
@click.prevent.stop="onFileClick(line.id, viewAction)"
:href="file.url"
class="file-video file-player"
target="_blank"
rel="noopener"
>
<span
v-if="previewSize"
Expand Down Expand Up @@ -353,11 +349,10 @@
<ul v-else class="file-other">
<li>
<a
@click.prevent="onFileClick(line.id, viewAction)"
@click.prevent.stop="onFileClick(line.id, viewAction)"
:href="file.url"
:download="file.name || file.url"
class="file-other-option file-other-option--get"
rel="noopener"
></a>
</li>
</ul>
Expand Down

0 comments on commit 745007d

Please sign in to comment.