I am trying to: move my website as part of new multisite. Everything seems to be working, except my custom js (that is working fine in old website, stopped working in new place only. Seems like no other custom js are working too.
I visited this URL: hidden link
I expected to see: category list in pop - up sidebar. On click it opens, it is supposed to close back on click. but
Instead, I got: instead it is put then to the bottom of that layout. On old version of website (single site) ir worked well.
No plugins except Toolset, domain mapping and network user / plugins manager are on.
Hello. Thank you for contacting the Toolset Support.
I reviewed your custom js code and I found some issues with it, regarding the toggleClass function. You use two string replace method, one with regular expression trying to eliminate the tab character, the new line character and the return character but you are actually doing it wrong. On the other replace method, you are trying to remove the added “clicked” class, but you are adding another space character at the end of your “search” phrase, which makes the class not to be removed.
Please use the suggested code below and let me know if it fixes your issues.
*** Please keep in mind to backup your current code in case my suggestion doesn’t work. ***
function toggleClass(elem, className) {
var newClass = ' ' + elem.className.replace( /\[trn]/g, " " ) + ' ';
if (hasClass(elem, className)) {
while (newClass.indexOf(" " + className + " ") >= 0 ) {
newClass = newClass.replace( " " + className, " " );
}
elem.className = newClass.replace(/^s+|s+$/g, '');
} else {
elem.className += ' ' + className;
}
}
If you have any further issues or questions, please let me know.
Regards