lib/generators/bs5/install/templates/bs5.js in bs5-0.0.24 vs lib/generators/bs5/install/templates/bs5.js in bs5-0.0.25
- old
+ new
@@ -1,24 +1,35 @@
import * as bootstrap from "bootstrap";
-function tooltipify() {
- const tooltipTriggerList = [].slice.call(
- document.querySelectorAll('[data-bs-toggle="tooltip"]')
- );
- tooltipTriggerList.map(function (tooltipTriggerEl) {
- return new bootstrap.Tooltip(tooltipTriggerEl);
- });
+function popoverify() {
+ document
+ .querySelectorAll('[data-bs-toggle="popover"]')
+ .forEach(function (popoverTriggerEl) {
+ new bootstrap.Popover(popoverTriggerEl);
+ });
}
-function popoverify() {
- const popoverTriggerList = [].slice.call(
- document.querySelectorAll('[data-bs-toggle="popover"]')
- );
- popoverTriggerList.map(function (popoverTriggerEl) {
- return new bootstrap.Popover(popoverTriggerEl);
+function toastify() {
+ document.querySelectorAll(".toast").forEach(function (toastNode) {
+ let autohide = new RegExp("true", "i").test(
+ toastNode.dataset["bsAutohide"] || "false"
+ );
+ let toast = new bootstrap.Toast(toastNode, {
+ autohide,
+ });
+ toast.show();
});
}
+function tooltipify() {
+ document
+ .querySelectorAll('[data-bs-toggle="tooltip"]')
+ .forEach(function (tooltipTriggerEl) {
+ new bootstrap.Tooltip(tooltipTriggerEl);
+ });
+}
+
export function start() {
popoverify();
+ toastify();
tooltipify();
}