diff options
Diffstat (limited to 'app/assets/javascripts/tooltips')
-rw-r--r-- | app/assets/javascripts/tooltips/components/tooltips.vue | 8 | ||||
-rw-r--r-- | app/assets/javascripts/tooltips/index.js | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/assets/javascripts/tooltips/components/tooltips.vue b/app/assets/javascripts/tooltips/components/tooltips.vue index 05927006ea6..15fc84368b2 100644 --- a/app/assets/javascripts/tooltips/components/tooltips.vue +++ b/app/assets/javascripts/tooltips/components/tooltips.vue @@ -50,7 +50,8 @@ export default { addTooltips(elements, config) { const newTooltips = elements .filter(element => !this.tooltipExists(element)) - .map(element => newTooltip(element, config)); + .map(element => newTooltip(element, config)) + .filter(tooltip => tooltip.title); newTooltips.forEach(tooltip => this.observe(tooltip)); @@ -93,6 +94,9 @@ export default { return this.tooltips.find(tooltip => tooltip.target === element); }, }, + safeHtmlConfig: { + ADD_TAGS: ['gl-emoji'], + }, }; </script> <template> @@ -110,7 +114,7 @@ export default { :disabled="tooltip.disabled" :show="tooltip.show" > - <span v-if="tooltip.html" v-safe-html="tooltip.title"></span> + <span v-if="tooltip.html" v-safe-html:[$options.safeHtmlConfig]="tooltip.title"></span> <span v-else>{{ tooltip.title }}</span> </gl-tooltip> </div> diff --git a/app/assets/javascripts/tooltips/index.js b/app/assets/javascripts/tooltips/index.js index f7cad6639ae..335925aec5f 100644 --- a/app/assets/javascripts/tooltips/index.js +++ b/app/assets/javascripts/tooltips/index.js @@ -68,7 +68,7 @@ const invokeBootstrapApi = (elements, method) => { } }; -const isGlTooltipsEnabled = () => Boolean(window.gon.glTooltipsEnabled); +const isGlTooltipsEnabled = () => Boolean(window.gon.features?.glTooltips); const tooltipApiInvoker = ({ glHandler, bsHandler }) => (elements, ...params) => { if (isGlTooltipsEnabled()) { |