lavkach3
1document.addEventListener("DOMContentLoaded", function () {2"use strict";3// =================================4// Tooltip5// =================================6const tooltipTriggerList = Array.from(7document.querySelectorAll('[data-bs-toggle="tooltip"]')8);9tooltipTriggerList.forEach((tooltipTriggerEl) => {10new bootstrap.Tooltip(tooltipTriggerEl);11});12
13// =================================14// Popover15// =================================16var popoverTriggerList = [].slice.call(17document.querySelectorAll('[data-bs-toggle="popover"]')18);19var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {20return new bootstrap.Popover(popoverTriggerEl);21});22// =================================23// Hide preloader24// =================================25var preloader = document.querySelector(".preloader");26if (preloader) {27preloader.style.display = "none";28}29// =================================30// Increment & Decrement31// =================================32var quantityButtons = document.querySelectorAll(".minus, .add");33if (quantityButtons) {34quantityButtons.forEach(function (button) {35button.addEventListener("click", function () {36var qtyInput = this.closest("div").querySelector(".qty");37var currentVal = parseInt(qtyInput.value);38var isAdd = this.classList.contains("add");39
40if (!isNaN(currentVal)) {41qtyInput.value = isAdd42? ++currentVal43: currentVal > 044? --currentVal45: currentVal;46}47});48});49}50});51