Commit 45b00d60 authored by Sergey's avatar Sergey

Add body product

parent 8f9209b8
//= template/common/header.html
//= template/menu-list-catalog/index.html
//= template/breadcrumb/index.html
//= template/product-title/index.html
//= template/common/footer.html
\ No newline at end of file
'use strict'; // 'use strict';
//
(function () { // (function () {
var checkActive = function (list, elem) { // var checkActive = function (list, elem) {
list.forEach(function (item) { // list.forEach(function (item) {
console.log('Here!'); // console.log('Here!');
if(item !== elem){ // if(item !== elem){
if(item.classList.contains('active')){ // if(item.classList.contains('active')){
item.classList.remove('active'); // item.classList.remove('active');
} // }
} // }
}) // })
}; // };
//
var tabs = document.querySelector('.menu-list__mainpage'); // var tabs = document.querySelector('.menu-list__mainpage');
if(tabs) { // if(tabs) {
var tab = tabs.querySelectorAll('.menu-list__link'); // var tab = tabs.querySelectorAll('.menu-list__link');
tab.forEach(function (item, index) { // tab.forEach(function (item, index) {
item.addEventListener('click', function (evt) { // item.addEventListener('click', function (evt) {
checkActive(tab, item); // checkActive(tab, item);
if(item.classList.contains('active')){ // if(item.classList.contains('active')){
//
}else { // }else {
evt.preventDefault(); // evt.preventDefault();
item.classList.toggle('active'); // item.classList.toggle('active');
var productSlider = document.querySelectorAll('.product-slider__wrapper'); // var productSlider = document.querySelectorAll('.product-slider__wrapper');
productSlider[index].classList.add('active'); // productSlider[index].classList.add('active');
checkActive(productSlider, productSlider[index]); // checkActive(productSlider, productSlider[index]);
//
} // }
}) // })
}) // })
} // }
})(); // })();
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment