diff --git a/services/web/frontend/js/bootstrap-3.ts b/services/web/frontend/js/bootstrap-3.ts index 68d04baafe..2c7b3b8214 100644 --- a/services/web/frontend/js/bootstrap-3.ts +++ b/services/web/frontend/js/bootstrap-3.ts @@ -1,6 +1,4 @@ import 'bootstrap' import './features/contact-form' import './features/bookmarkable-tab/index' - -$('[data-ol-lang-selector-tooltip]').tooltip({ trigger: 'hover' }) -$('[data-toggle="tooltip"]').tooltip() +import './features/tooltip/index-bs3' diff --git a/services/web/frontend/js/bootstrap-5.ts b/services/web/frontend/js/bootstrap-5.ts index a4132ec789..b9dc3d8679 100644 --- a/services/web/frontend/js/bootstrap-5.ts +++ b/services/web/frontend/js/bootstrap-5.ts @@ -1,2 +1,3 @@ -import 'bootstrap-5' import './features/bookmarkable-tab/index-bs5' +import './features/tooltip/index-bs5' +import 'bootstrap-5' diff --git a/services/web/frontend/js/features/tooltip/index-bs3.ts b/services/web/frontend/js/features/tooltip/index-bs3.ts new file mode 100644 index 0000000000..e71965bcd1 --- /dev/null +++ b/services/web/frontend/js/features/tooltip/index-bs3.ts @@ -0,0 +1,2 @@ +$('[data-ol-lang-selector-tooltip]').tooltip({ trigger: 'hover' }) +$('[data-toggle="tooltip"]').tooltip() diff --git a/services/web/frontend/js/features/tooltip/index-bs5.ts b/services/web/frontend/js/features/tooltip/index-bs5.ts new file mode 100644 index 0000000000..ba40b16daf --- /dev/null +++ b/services/web/frontend/js/features/tooltip/index-bs5.ts @@ -0,0 +1,15 @@ +import { Tooltip } from 'bootstrap-5' + +const footerLanguageElement = document.querySelector( + '[data-ol-lang-selector-tooltip]' +) as Element + +const allTooltips = document.querySelectorAll('[data-bs-toggle="tooltip"]') + +// eslint-disable-next-line no-unused-vars +const footLangTooltip = new Tooltip(footerLanguageElement) + +allTooltips.forEach(element => { + // eslint-disable-next-line no-unused-vars + const tooltip = new Tooltip(element) +})