2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-05 16:42:29 +03:00

Be SSR friendly when accessing DOM objects

This commit is contained in:
Johann-S
2021-02-17 09:22:44 +02:00
committed by XhmikosR
parent c44d99f55c
commit 8306213650
23 changed files with 203 additions and 70 deletions
+1
View File
@@ -1,5 +1,6 @@
import { Tooltip } from '../../../dist/js/bootstrap.esm.js'
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
window.addEventListener('load', () => {
[].concat(...document.querySelectorAll('[data-bs-toggle="tooltip"]'))
.map(tooltipNode => new Tooltip(tooltipNode))