Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/themify-.../public/js
File: tbp-script.js
(function (Themify) {
[0] Fix | Delete
'use strict';
[1] Fix | Delete
/*
[2] Fix | Delete
*
[3] Fix | Delete
* Add To Cart Module Quantity Change
[4] Fix | Delete
*/
[5] Fix | Delete
function tbp_cart_icon_module_quantity(){
[6] Fix | Delete
let btn=this.closest('.tb_pro_add_to_cart');
[7] Fix | Delete
if(btn){
[8] Fix | Delete
btn=btn.getElementsByClassName('button')[0];
[9] Fix | Delete
if(btn){
[10] Fix | Delete
btn.setAttribute('data-quantity',parseInt(this.value));
[11] Fix | Delete
}
[12] Fix | Delete
}
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
/*
[16] Fix | Delete
*
[17] Fix | Delete
* Add To Cart Module
[18] Fix | Delete
*/
[19] Fix | Delete
function tbp_add_to_cart_module(el,type,isLazy){
[20] Fix | Delete
if(Themify.is_builder_active){
[21] Fix | Delete
const items = Themify.selectWithParent('single_add_to_cart_button',el);
[22] Fix | Delete
for(let i=items.length-1;i>-1;--i){
[23] Fix | Delete
items[i].classList.add('disabled');
[24] Fix | Delete
}
[25] Fix | Delete
}
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
/*
[29] Fix | Delete
* Cart Icon Module
[30] Fix | Delete
* */
[31] Fix | Delete
function tbp_cart_icon_module(el,type,isLazy) {
[32] Fix | Delete
if(isLazy===true && !el[0].classList.contains('module-cart-icon')){
[33] Fix | Delete
return;
[34] Fix | Delete
}
[35] Fix | Delete
const mods=Themify.selectWithParent('tbp_slide_cart',el);
[36] Fix | Delete
if(mods[0]){
[37] Fix | Delete
// Slide cart icon
[38] Fix | Delete
for(let i=mods.length-1;i>-1;--i){
[39] Fix | Delete
Themify.sideMenu(mods[i].previousElementSibling,{
[40] Fix | Delete
close: '#' + mods[i].getElementsByClassName('tbp_cart_icon_close')[0].getAttribute('id')
[41] Fix | Delete
});
[42] Fix | Delete
}
[43] Fix | Delete
// Show & Hide cart icon on add to cart event
[44] Fix | Delete
const firstItem=mods[0].previousElementSibling;
[45] Fix | Delete
Themify.body.on('added_to_cart', function (e) {
[46] Fix | Delete
firstItem.click();
[47] Fix | Delete
});
[48] Fix | Delete
}
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/*
[52] Fix | Delete
* Search Form Module
[53] Fix | Delete
* */
[54] Fix | Delete
function tbp_search_form_module(el,type,isLazy) {
[55] Fix | Delete
if (!el || (isLazy === true && ! el[0].classList.contains( 'module-search-form' )) ){
[56] Fix | Delete
return;
[57] Fix | Delete
}
[58] Fix | Delete
const item=el[0],
[59] Fix | Delete
ajax_type = item.dataset['ajax'];
[60] Fix | Delete
if(''===ajax_type){
[61] Fix | Delete
return;
[62] Fix | Delete
}
[63] Fix | Delete
Themify.ajaxSearch({
[64] Fix | Delete
type:ajax_type,
[65] Fix | Delete
both:ajax_type==='dropdown',
[66] Fix | Delete
el:'overlay'===ajax_type?item.getElementsByClassName('tbp_icon_search')[0]:item.querySelector('input[name="s"]'),
[67] Fix | Delete
container:'overlay'===ajax_type?item.getElementsByClassName('search-lightbox-wrap')[0]:item,
[68] Fix | Delete
post_type:item.dataset['postType']
[69] Fix | Delete
});
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
function Run(){
[73] Fix | Delete
Themify.body.on('change','.tb_pro_add_to_cart input',tbp_cart_icon_module_quantity)
[74] Fix | Delete
.on('click', '.tbp_remove_from_cart_button', function (e) {// remove item ajax
[75] Fix | Delete
e.preventDefault();
[76] Fix | Delete
this.classList.remove('tf_close');
[77] Fix | Delete
this.classList.add('tf_loader');
[78] Fix | Delete
});
[79] Fix | Delete
Themify.on( 'builder_load_module_partial', function(el,type,isLazy){
[80] Fix | Delete
tbp_add_to_cart_module(el,type,isLazy);
[81] Fix | Delete
tbp_cart_icon_module(el,type,isLazy);
[82] Fix | Delete
tbp_search_form_module(el,type,isLazy);
[83] Fix | Delete
} );
[84] Fix | Delete
}
[85] Fix | Delete
if(window.loaded){
[86] Fix | Delete
Run();
[87] Fix | Delete
}
[88] Fix | Delete
else{
[89] Fix | Delete
window.addEventListener('load', Run, {once:true, passive:true});
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
})(Themify);
[93] Fix | Delete
[94] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function