diff options
-rw-r--r-- | app/assets/javascripts/vue_shared/components/tooltip_on_truncate.vue | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/assets/javascripts/vue_shared/components/tooltip_on_truncate.vue b/app/assets/javascripts/vue_shared/components/tooltip_on_truncate.vue index a567ac80464..88ebdfb102f 100644 --- a/app/assets/javascripts/vue_shared/components/tooltip_on_truncate.vue +++ b/app/assets/javascripts/vue_shared/components/tooltip_on_truncate.vue @@ -7,16 +7,21 @@ export default { GlTooltip: GlTooltipDirective, }, props: { - title: { + boundary: { type: String, required: false, - default: '', + default: 'viewport', }, placement: { type: String, required: false, default: 'top', }, + title: { + type: String, + required: false, + default: '', + }, truncateTarget: { type: [String, Function], required: false, @@ -31,6 +36,8 @@ export default { mounted() { const target = this.selectTarget(); + // NOTE: The secondary test allows for strings or spans to be passed + // directly to this component if ( target && (target.scrollWidth > target.offsetWidth || @@ -56,9 +63,8 @@ export default { <template> <span v-if="showTooltip" - v-gl-tooltip="{ boundary: 'viewport', placement }" + v-gl-tooltip="{ boundary, placement }" :title="title" - :data-placement="placement" class="js-show-tooltip" > <slot></slot> |