diff options
Diffstat (limited to 'app/assets/javascripts/code_navigation/components/popover.vue')
-rw-r--r-- | app/assets/javascripts/code_navigation/components/popover.vue | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/assets/javascripts/code_navigation/components/popover.vue b/app/assets/javascripts/code_navigation/components/popover.vue index d5bbe430fcd..f216a4c6e6f 100644 --- a/app/assets/javascripts/code_navigation/components/popover.vue +++ b/app/assets/javascripts/code_navigation/components/popover.vue @@ -14,6 +14,10 @@ export default { type: Object, required: true, }, + definitionPathPrefix: { + type: String, + required: true, + }, }, data() { return { @@ -27,6 +31,11 @@ export default { top: `${this.position.y + this.position.height}px`, }; }, + definitionPath() { + return ( + this.data.definition_path && `${this.definitionPathPrefix}/${this.data.definition_path}` + ); + }, }, watch: { position: { @@ -67,8 +76,8 @@ export default { {{ hover.value }} </p> </div> - <div v-if="data.definition_url" class="popover-body"> - <gl-button :href="data.definition_url" target="_blank" class="w-100" variant="default"> + <div v-if="definitionPath" class="popover-body"> + <gl-button :href="definitionPath" target="_blank" class="w-100" variant="default"> {{ __('Go to definition') }} </gl-button> </div> |