Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/vue_shared/directives/tooltip.js')
-rw-r--r--app/assets/javascripts/vue_shared/directives/tooltip.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/directives/tooltip.js b/app/assets/javascripts/vue_shared/directives/tooltip.js
index 73e92728cb9..0eb505bfce8 100644
--- a/app/assets/javascripts/vue_shared/directives/tooltip.js
+++ b/app/assets/javascripts/vue_shared/directives/tooltip.js
@@ -1,5 +1,6 @@
import $ from 'jquery';
import '~/commons/bootstrap';
+import { parseBoolean } from '~/lib/utils/common_utils';
export default {
bind(el) {
@@ -9,6 +10,10 @@ export default {
$(el).tooltip({
trigger: 'hover',
delay,
+ // By default, sanitize is run even if there is no `html` or `template` present
+ // so let's optimize to only run this when necessary.
+ // https://github.com/twbs/bootstrap/blob/c5966de27395a407f9a3d20d0eb2ff8e8fb7b564/js/src/tooltip.js#L716
+ sanitize: parseBoolean(el.dataset.html) || Boolean(el.dataset.template),
});
},