|
@@ -52,27 +52,32 @@ const searchButton = document.querySelector(".search-btn-mobile")
|
|
// header sub-menu
|
|
// header sub-menu
|
|
|
|
|
|
const megaSubMenu = document.querySelectorAll('.megamenu-submenu .items');
|
|
const megaSubMenu = document.querySelectorAll('.megamenu-submenu .items');
|
|
- const subMenuItemsAll = document.querySelectorAll('.megamenu-submenu .submenu-items')
|
|
|
|
-
|
|
|
|
|
|
|
|
- megaSubMenu.forEach(menu => {
|
|
|
|
- const subMenuBtn = menu.querySelector('.submenu-buton');
|
|
|
|
- const subMenuItems = menu.querySelector('.submenu-items')
|
|
|
|
|
|
+ const subMenuItemsAll = document.querySelectorAll('.megamenu-submenu .submenu-items')
|
|
|
|
|
|
- if (subMenuItems && subMenuBtn) {
|
|
|
|
|
|
+ if(megaSubMenu) {
|
|
|
|
|
|
- subMenuBtn.addEventListener('click', () => {
|
|
|
|
- subMenuItems.classList.toggle('active')
|
|
|
|
|
|
+ megaSubMenu.forEach(menu => {
|
|
|
|
+ const subMenuBtn = menu.querySelector('.submenu-buton');
|
|
|
|
+ const subMenuItems = menu.querySelector('.submenu-items')
|
|
|
|
|
|
- subMenuItemsAll.forEach(item => {
|
|
|
|
- if (item !== subMenuItems) {
|
|
|
|
- item.classList.remove("active")
|
|
|
|
- }
|
|
|
|
|
|
+ if (subMenuItems && subMenuBtn) {
|
|
|
|
+
|
|
|
|
+ subMenuBtn.addEventListener('click', () => {
|
|
|
|
+ subMenuItems.classList.toggle('active')
|
|
|
|
+
|
|
|
|
+ subMenuItemsAll.forEach(item => {
|
|
|
|
+ if (item !== subMenuItems) {
|
|
|
|
+ item.classList.remove("active")
|
|
|
|
+ }
|
|
|
|
+ })
|
|
})
|
|
})
|
|
- })
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
// burger menu function
|
|
// burger menu function
|
|
@@ -139,8 +144,6 @@ const searchButton = document.querySelector(".search-btn-mobile")
|
|
const checkoutContainer = document.querySelector('.checkout-container')
|
|
const checkoutContainer = document.querySelector('.checkout-container')
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
// checkout open function for desktop
|
|
// checkout open function for desktop
|
|
if(checkoutProductBtnDesktop && checkoutContainer) {
|
|
if(checkoutProductBtnDesktop && checkoutContainer) {
|
|
checkoutProductBtnDesktop.addEventListener('click', () => {
|
|
checkoutProductBtnDesktop.addEventListener('click', () => {
|