MAURIPRO
${newValue}
`;
}
}
],
handleAttributes: [
{'aria-label': `lower - ${this.filterCode}`},
{'aria-label': `upper - ${this.filterCode}`}
],
}
},
/**
*
* @param coefficient ex. 0.3 - 30% lighter; -0.3 - 30% darker
* @param color {string} hex, rgb, rgba
* @returns {null|string}
* @private
*/
_newShade(coefficient, color) {
return pSBC(coefficient, color);
},
/**
*
* @param lightenColor
* @param color
* @param type {string} 'vertical' || 'horizontal'
* @returns {string}
* @private
*/
_generateGradient(lightenColor, color, type) {
if (type === 'vertical') {
return 'linear-gradient(160deg, ' + lightenColor + '40%, ' + color + ' 100%)';
}
if (type === 'horizontal') {
return 'linear-gradient(270deg,' + color + ' 0%, ' + lightenColor + ' 100%)';
}
},
/**
*
* @param searchParams {string}
* @param values {string}
* @private
*/
_dispatchEventsForAjax(searchParams, values) {
setTimeout(() => {
window.dispatchEvent(new CustomEvent('amSliderValuesUpdated', {
detail: {
searchParams: searchParams,
values: values,
element: this.filterElement
}
}));
}, 0);
},
eventListeners: {
['@noUiSliderLoaded.window']() {
this.sliderLoaded = true;
},
['@clearSlider.window']() {
const priceInputs = document.querySelectorAll(
`[name="amshopby[${this.code}][]"]`
);
if (priceInputs.length > 1) {
priceInputs.forEach(price => {
price.value = '';
});
}
}
}
}
}