From e3702878cd6d286edf3145cf18d34724b9aea3f7 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Thu, 10 Aug 2023 23:31:34 +0100 Subject: [PATCH] fix: register pre-existing bs tooltips --- src/ts/UI.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ts/UI.ts b/src/ts/UI.ts index d4b70e1..11e4d95 100644 --- a/src/ts/UI.ts +++ b/src/ts/UI.ts @@ -81,6 +81,10 @@ class UI { */ public static addBootstrapTooltips(element?: Element) { element = element || document.body; + + const list = element.querySelectorAll('[data-bs-toggle="tooltip"]'); + list.forEach((el: Element) => new bootstrap.Tooltip(el)); + element.querySelectorAll("[title]").forEach((el) => { el.setAttribute("data-bs-toggle", "tooltip"); el.setAttribute("data-bs-placement", "bottom");