From 8407b24ae76aaa9738f882f849ffa8b299b3e00b Mon Sep 17 00:00:00 2001 From: William Entriken Date: Sat, 19 Oct 2024 12:17:02 -0400 Subject: [PATCH 1/2] Simpler tooltip initialization --- site/content/docs/5.3/components/tooltips.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/site/content/docs/5.3/components/tooltips.md b/site/content/docs/5.3/components/tooltips.md index 64ded72a44c9..2e9eaf50bb71 100644 --- a/site/content/docs/5.3/components/tooltips.md +++ b/site/content/docs/5.3/components/tooltips.md @@ -37,8 +37,7 @@ Got all that? Great, let's see how they work with some examples. As mentioned above, you must initialize tooltips before they can be used. One way to initialize all tooltips on a page would be to select them by their `data-bs-toggle` attribute, like so: ```js -const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]') -const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)) +document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => new bootstrap.Tooltip(el)); ``` ### Tooltips on links From 340dfad97148c934c04df844227eaabc83b79dfc Mon Sep 17 00:00:00 2001 From: William Entriken Date: Sat, 19 Oct 2024 12:27:38 -0400 Subject: [PATCH 2/2] Code style --- site/content/docs/5.3/components/tooltips.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/docs/5.3/components/tooltips.md b/site/content/docs/5.3/components/tooltips.md index 2e9eaf50bb71..de64e9770a0a 100644 --- a/site/content/docs/5.3/components/tooltips.md +++ b/site/content/docs/5.3/components/tooltips.md @@ -37,7 +37,7 @@ Got all that? Great, let's see how they work with some examples. As mentioned above, you must initialize tooltips before they can be used. One way to initialize all tooltips on a page would be to select them by their `data-bs-toggle` attribute, like so: ```js -document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => new bootstrap.Tooltip(el)); +document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => new bootstrap.Tooltip(el)) ``` ### Tooltips on links