How to modify your javascript files or add functionality?
-
Hi, plugin is awesome, thank you!
I made that change in xoo-wsc-public.js file, it trigers closing my popups when “toggle side cart” and when “close side cart”.
Is it possible to somehow do the same without editing your files soo an update won’t override my changes?
Below is what I added:
My code:
$('a.evr-close').click();
First change is here: `//Toggle Side Cart
function toggle_sidecart(toggle_type){
var toggle_element = $(‘.xoo-wsc-modal , body, html’),
toggle_class = ‘xoo-wsc-active’;
$(‘a.evr-close’).click();if(toggle_type == ‘show’){
toggle_element.addClass(toggle_class);
}
else if(toggle_type == ‘hide’){
toggle_element.removeClass(toggle_class);
}
else{
toggle_element.toggleClass(‘xoo-wsc-active’);
}unblock_cart();
}$(‘.xoo-wsc-basket’).on(‘click’,toggle_sidecart);
if(xoo_wsc_localize.trigger_class){
$(‘.’+xoo_wsc_localize.trigger_class).on(‘click’,toggle_sidecart);
}`Second change is here: ` //Close Side Cart
function close_sidecart(e){
$.each(e.target.classList,function(key,value){
if(value != ‘xoo-wsc-container’ && (value == ‘xoo-wsc-close’ || value == ‘xoo-wsc-opac’ || value == ‘xoo-wsc-basket’ || value == ‘xoo-wsc-cont’)){
$(‘.xoo-wsc-modal , body, html’).removeClass(‘xoo-wsc-active’);
$(‘a.evr-close’).click();
}
})
}`
- The topic ‘How to modify your javascript files or add functionality?’ is closed to new replies.