Skip to content

Commit

Permalink
Merge pull request #29 from utomic-media/fix/unified-link-targets
Browse files Browse the repository at this point in the history
Fix/unified link targets
  • Loading branch information
Dominic-Marcelino committed Mar 24, 2023
2 parents bf2f4ca + 8e1647d commit c6bc826
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/display/display.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
class="dynamic-wrapper"
:href="computedLink"
v-tooltip.left="actionTooltip"
target="_blank"
rel="noopener noreferrer"
>
<span
:class="hasValueClickAction ? 'action-background' : ''"
Expand Down Expand Up @@ -115,6 +117,11 @@ function valueClickAction(e: Event) {
e.stopPropagation();
copyValue();
}
if (props.clickAction === 'link') {
// We opened a link in a new tab and don't want to get into the details view of the item
e.stopPropagation();
}
// else go on with the default events
}
Expand Down
6 changes: 6 additions & 0 deletions src/interface/interface.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ function valueClickAction(e: Event) {
e.stopPropagation();
copyValue();
}
if (props.clickAction === 'link' && props.disabled && props.value) {
e.stopPropagation();
window.open(computedLink.value, '_blank', 'noopener, noreferrer');
}
// else go on with the default events
}
Expand Down

0 comments on commit c6bc826

Please sign in to comment.