Ingen produkter tilgjengelig for valgt filter
$(document).ready(function(){
hideBreadCrumbList();
renderBreadcrumb();
setFilterfields('vgr=90');
hideBreadCrumbList('N');
});
if(document.querySelector(".filter-result")!==null){
document.querySelector(".filter-result").style.display='none';
}
function enableFilter(filter) {
var enabledFilter=[];
if (filter) {
enabledFilter = filter;
}else{
}
var t = document.querySelectorAll(".merkeFilter");
if (enabledFilter.length > 0) {
enabledFilter.split(",").forEach(obj1 => {
t.forEach(obj => {
var textContent = obj.innerText;
if(obj.parentNode.className.includes("listtype2-row")){
if(!enabledFilter.includes(textContent) && !obj.parentNode.children[3].className.includes("productVarientContainer")){
obj.parentNode.parentNode.style.display = 'none';
} else if (obj.parentNode.children[3].className.includes("productVarientContainer")) {
var currentVarientProd = (obj.parentNode.children[3].children[0].id).replace('productVarient', '');
var subVarients = document.querySelectorAll(".merkeVariantFilter" + currentVarientProd);
obj.parentNode.parentNode.style.display = 'none';
subVarients.forEach(subObj => {
if (enabledFilter.includes(subObj.textContent)) {
subObj.parentNode.parentNode.parentNode.style.display = 'table-row';
obj.parentNode.parentNode.style.display = 'block';
} else {
subObj.parentNode.parentNode.parentNode.style.display = 'none';
}
});
}else{
obj.parentNode.parentNode.style.display = 'block';
}
}else if (textContent !== obj1 && !enabledFilter.includes(textContent)) {
obj.parentNode.parentNode.style.display = 'none';
} else {
if (document.querySelector(".listtype1-table") !== null) {
obj.parentNode.parentNode.style.display = 'table-row';
} else {
obj.parentNode.parentNode.style.display = 'block';
}
}
});
});
} else {
t.forEach(obj => {
if (document.querySelector(".listtype1-table") !== null) {
obj.parentNode.parentNode.style.display = 'table-row';
} else if(obj.parentNode.className.includes("listtype2-row")){
if (obj.parentNode.children[3].className.includes("productVarientContainer")) {
var currentVarientProd = (obj.parentNode.children[3].children[0].id).replace('productVarient', '');
var subVarients = document.querySelectorAll(".merkeVariantFilter" + currentVarientProd);
obj.parentNode.parentNode.style.display = 'block';
subVarients.forEach(subObj => {
subObj.parentNode.parentNode.parentNode.style.display = 'table-row';
});
}else{
obj.parentNode.parentNode.style.display = 'block';
}
} else {
obj.parentNode.parentNode.style.display = 'block';
}
});
}
}
var productListType5=document.querySelectorAll(".productListType5");
window.onresize = doVareResize;
window.onload = doVareResize;
//Breadcrumb Code Starts here
//Breadcrumb Code Ends here
productListType5.forEach(obj=>{
obj.classList.add("productItemContainer_active");
});
parent.$('#topScrollButton').click();
$(".filter-products").click(function(){
var overlay_filters=parent.document.querySelector(".overlay-filters");
if(overlay_filters!==null){
overlay_filters.style.transform='translateY(0%)';
parent.document.body.style.overflow='hidden';
parent.document.querySelector("#fixed-footer").style.transform='translateY(1000%)';
}
});
var filter_varesok_frame=document.querySelector(".filter-varesok-frame");
var show_filter_tab=document.querySelector(".show_filter_tab");
var hide_filter_tab=document.querySelector(".hide_filter_tab");
var last_val='';
$(".show_filter_tab").click(function(){
if(filter_varesok_frame!==null){
filter_varesok_frame.style.cssText='display:block! important';
show_filter_tab.style.cssText='display:none! important';
hide_filter_tab.style.cssText='display:flex! important';
}
});
$(".hide_filter_tab").click(function(){
if(filter_varesok_frame!==null){
filter_varesok_frame.style.cssText='display:none! important';
show_filter_tab.style.cssText='display:flex! important';
hide_filter_tab.style.cssText='display:none! important';
}
});
function showTable(id){
if(document.querySelector('.showStocksStatusTable'+id).classList.contains("showTable")){
document.querySelector('.showStocksStatusTable'+id).classList.remove('showTable');
document.querySelector('.showStocksStatusTable'+id).classList.add('hideTable');
document.querySelector('.show-stock-text'+id).style.display='block';
document.querySelector('.hide-stock-text'+id).style.display='none';
}else{
document.querySelector('.showStocksStatusTable'+id).classList.remove('hideTable');
document.querySelector('.showStocksStatusTable'+id).classList.add('showTable');
document.querySelector('.show-stock-text'+id).style.display='none';
document.querySelector('.hide-stock-text'+id).style.display='block';
}
doVareResize();
}
$(".box_overskrifttxt a").click(function(){
scrollToTop();
});
$(".add-produkt-favorite").click(function(){
parent.addProductFavoritte(this);
});
$(".input-quantity").on("change",function(){
var evt=$(this);
if(evt.val()==="" || evt.val()==="-"){
evt.val(evt.attr("value"));
}
});
$(".input-quantity").on("input",function(){
var regexp = /^[-]*[0-9]*[.,]{0,1}[0-9]{0,2}$/;
var evt=$(this);
if(regexp.test(evt.val())){
last_val=evt.val();
}else{
evt.val(last_val);
}
if (this.value > this.maxLength){
this.value = this.maxLength;
}else if(this.value<0){
if (this.value < -(this.maxLength)){
this.value = -(this.maxLength);
}
}
});
$(".remove-produkt-favorite").click(function(){
parent.addProductFavoritte(this);
if(this.closest(".productListType5")!==null){
this.closest(".productListType5").style.display='none';
}
if(this.closest(".varedetaljerList2")!==null){
this.closest(".varedetaljerList2").style.display='none';
}
doVareResize();
});
if(window.matchMedia("(max-width: 767.9px)").matches){
showLastParent();
}
|