ldc-lionor/resources/ts/modules/bsTooltips.ts
2023-03-07 10:55:12 +00:00

26 lines
855 B
TypeScript

import type * as bootstrap from "bootstrap";
export default {
methods: {
tooltips: [] as Array<bootstrap.Tooltip>,
initTooltips(): void {
if (this.tooltips) {
this.tooltips.forEach((tooltip) => {
tooltip.disable();
tooltip.hide();
});
}
this.tooltips = [].slice
.call(document.querySelectorAll("[data-bs-toggle=\"tooltip\"]"))
.map(function (tooltipTriggerEl) {
return new window.bootstrap.Tooltip(tooltipTriggerEl, {
customClass: "large-tooltip",
delay: {
show: 1250,
hide: 0,
},
});
});
},
},
};