Skip to content

Commit

Permalink
Merge pull request #16432 from dannon/ctrlclickdisplay
Browse files Browse the repository at this point in the history
[23.1] For display (only) allow control+click for new window opening
  • Loading branch information
jmchilton authored Jul 21, 2023
2 parents 31b20ac + 7f8d4ec commit 4def6e2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions client/src/components/History/Content/ContentOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@click.prevent.stop="$emit('showCollectionInfo')">
<icon icon="info-circle" />
</b-button>

<!-- Common for all content items -->
<b-button
v-if="isDataset"
Expand All @@ -22,7 +21,7 @@
size="sm"
variant="link"
:href="displayUrl"
@click.prevent.stop="$emit('display')">
@click.prevent.stop="onDisplay($event)">
<icon icon="eye" />
</b-button>
<b-button
Expand Down Expand Up @@ -121,5 +120,16 @@ export default {
return this.keyboardSelectable ? "0" : "-1";
},
},
methods: {
onDisplay($event) {
// Wrap display handler to allow ctrl/meta click to open in new tab
// instead of triggering display.
if ($event.ctrlKey || $event.metaKey) {
window.open(this.displayUrl, "_blank");
} else {
this.$emit("display");
}
},
},
};
</script>

0 comments on commit 4def6e2

Please sign in to comment.